# Dynamic predictions multi state model with time dependent covariates

**URL:** <https://discourse.datamethods.org/t/dynamic-predictions-multi-state-model-with-time-dependent-covariates/4118>\
**Category:** modeling strategy\
**Tags:** time-depcovariate, dynamic\
**Created:** [February 7, 2021, 6:51pm UTC](https://discourse.datamethods.org/t/dynamic-predictions-multi-state-model-with-time-dependent-covariates/4118 "2021-02-07T18:51:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlocav](https://discourse.datamethods.org/letter_avatar_proxy/v4/letter/c/76d3ee/32.png) [@carlocav](https://discourse.datamethods.org/u/carlocav)\
**Post date:** [February 7, 2021, 6:51pm UTC](https://discourse.datamethods.org/t/dynamic-predictions-multi-state-model-with-time-dependent-covariates/4118/1 "2021-02-07T18:51:46Z")

</div>

Hello,  
I need to make dynamic predictions of the time of assembly of machines.

Since I want to update forecast when parts of the machine have been made, I need multi-state models.

Since I have time dependent covariates, such as the number of missing parts required to make the machine, I think I have 2 options: time dependent Cox regression or joint model of longitudinal and multi-state model.

Unfortunately I have not found any R package that allow to make dynamic predictions with these models.

For example JMBayes/JMBayes2 doesn’t allow dynamic predictions from multistate model

Mstate + Cox doesn’t allow combining time varying covariates with multi-state models

Do you know any R packages that can help me or suggestions on how I can fit these models and use them to make predictions?

---

<div class="post-metadata">

**Author:** ![davidcnorrismd](https://discourse.datamethods.org/user_avatar/discourse.datamethods.org/davidcnorrismd/32/3502_2.png) [@davidcnorrismd](https://discourse.datamethods.org/u/davidcnorrismd)\
**Post date:** [February 8, 2021, 12:03pm UTC](https://discourse.datamethods.org/t/dynamic-predictions-multi-state-model-with-time-dependent-covariates/4118/2 "2021-02-08T12:03:01Z")

</div>

You might try [pomp](https://cran.r-project.org/package=pomp)—which stands for Partially Observed Markov Processes. I used this package for a state-space model in my [DTAT paper](https://f1000research.com/articles/6-112/v3), and found it a wonderful way to gain access to advanced methods within the [data assimilation](https://en.wikipedia.org/wiki/Data_assimilation) sphere. The documentation is excellent, too.
