# Joint longitudinal + time-to-event modelling in Julia?

**URL:** <https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388>\
**Category:** Statistics\
**Tags:** modelling\
**Created:** [October 27, 2022, 6:24pm UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388 "2022-10-27T18:24:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielinteractive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielinteractive/32/43912_2.png) [@danielinteractive](https://discourse.julialang.org/u/danielinteractive)\
**Post date:** [October 27, 2022, 6:24pm UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388/1 "2022-10-27T18:24:50Z")

</div>

Hi everyone,

I am new to Julia, and curious if somebody did any work on joint modelling of longitudinal and time-to-event data already and can share any code examples as starting points for me?

Thanks,  
cheers  
Daniel

---

<div class="post-metadata">

**Author:** ![awasserman](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@awasserman](https://discourse.julialang.org/u/awasserman)\
**Post date:** [October 27, 2022, 8:47pm UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388/2 "2022-10-27T20:47:57Z")

</div>

Hello!

I’m not familiar with any Julia implementations of joint modeling. If you’re familiar with Stan, there’s the implementation done for rstanarm here:

> <https://github.com/stan-dev/rstanarm/blob/master/src/stan_files/jm.stan>

with supporting documentation on the method here:

> **[Estimating Joint Models for Longitudinal and Time-to-Event Data with rstanarm](https://mc-stan.org/rstanarm/articles/jm.html#technical-details-1)**
>
> rstanarm

I think this could be readily translated to something like [Turing.jl](https://turing.ml/stable/) if you want a similarly Bayesian approach, but a direct translation of the Stan code would not be appealing to me (nothing against the authors of that code, just a reflection of the differences between the domain-specific language of Stan and the expressiveness of Julia).

---

<div class="post-metadata">

**Author:** ![danielinteractive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielinteractive/32/43912_2.png) [@danielinteractive](https://discourse.julialang.org/u/danielinteractive)\
**Post date:** [October 28, 2022, 6:54am UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388/3 "2022-10-28T06:54:56Z")

</div>

Thanks @awasserman - yeah we do also have our own stan implementations already of these models, but would like to explore Julia now and see if that improves the code readability / maintenance outlook while maintaining or improving speed etc. I guess we get started from [Tutorials](https://turing.ml/v0.21/tutorials) - unless somebody has some code already 🙂

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [October 28, 2022, 8:49am UTC](https://discourse.julialang.org/t/joint-longitudinal-time-to-event-modelling-in-julia/89388/4 "2022-10-28T08:49:33Z")

</div>

> [@danielinteractive](#):
>
> we do also have our own stan implementations already of these models

Then converting them to Turing might not be that difficult if you already know the math and how your model functions, you’ll only have to learn how Turing works 🙂
