CecileProust-Lima / lcmm

R package lcmm
https://CecileProust-Lima.github.io/lcmm/
58 stars 13 forks source link

Estimating the Hazard Function from an mpjlcmm model. #283

Closed Diego-FB closed 1 week ago

Diego-FB commented 1 week ago

Dear Viviane ande Cecile,

We are aware that dynpred is unavailable for mpjlcmm models (issue #164 ). However, for some validation and visualization it could be useful to estimate individual hazards based on the output of the survivial (Weibul) model. We have a bivariate latent class model linked to survival with two covariables and a third time-dependent covariable. We are obtaining the following output of the survival part of the fitted mpjlcmm model:

                             coef      Se    Wald p-value
event1 +/-sqrt(Weibull1)  0.06504 0.00967   6.728 0.00000
event1 +/-sqrt(Weibull2)  1.32200 0.03413  38.731 0.00000
event1 SurvPH class1      3.35880 0.44508   7.547 0.00000
event1 SurvPH class2      1.01564 0.27997   3.628 0.00029
Age.0                     0.05303 0.00567   9.349 0.00000
Male                      0.13095 0.09877   1.326 0.18489
I(t>tAVR)                -0.05475 0.25972  -0.211 0.83304

We would very much appreciate if you could provide us with the formula to estimate an individual hazard based on these coefficients, for given values of class membership (or, even better its probability), and the covariables.

Looking forward hearing from you again, best regards

VivianePhilipps commented 1 week ago

Hi,

the parametrization of the weibull is so that the baseline instantaneous risk of event at time t for the reference class (class 3 here) is h0(t, class = 3) = w1^2 w2^2 (w1^2 * t)^(w2^2 -1) with w1 = 0.06504 and w2 = 1.32200.

For class 1, you include the proportional coefficient h0(t, class = 1) = h0(t, class = 3) * exp(ph1) with ph1 = 3.35880.

If you want to include the covariate it becomes h(t, class = 1) = h0(t, class = 1) exp(gamma1 Age0 + gamma2 Male) before time tAVR and h(t, class = 1) = h0(t, class = 1) exp(gamma1 Age0 + gamma2 Male + gamma3) after time tAVR with gamma1 = 0.05303, gamma2 = 0.13095 and gamma3 = -0.05475.

For the cumulative hazard until time t, with an intermediate time tAVR (so with 0 < tAVR < t), you have for class 1 for example H(t) = H0(tAVR) exp(ph1) exp(gamma1 Age0 + gamma2 Male) + ( H0(t) - H0(tAVR) ) exp(ph1) exp(gamma1 Age0 + gamma2 Male + gamma3)

with H0(t) = (w1^2 * t)^(w2^2)

Does it answer your question ?

Viviane

Diego-FB commented 1 week ago

Thank you for your rapid response. Yes, indeed it answers our question, meanwhile we found the information on the Jointlcmm() documentation, thanks for the thorough answer and complementing with the cumulative hazard, you do a tremendous job on documenting and answering the community, much appreciated.

Best regards from Madrid