drizopoulos / JMbayes2

Extended Joint Models for Longitudinal and Survival Data
https://drizopoulos.github.io/JMbayes2/
79 stars 23 forks source link

Computing population median survival time #60

Closed JulietteOrtholand closed 1 year ago

JulietteOrtholand commented 1 year ago

Hi,

I am looking to access a proxy of the median survival of a population. As far as I understand your joint model, the survival process is modelled by splines for which median parameter values are available after fit at jm$statistics$Median$bs_gammas. I am wondering if it is possible to access the median survival learnt for the patient with the null random effect more easily than by hand computation with the extracted values of the bs_gammas.

Many thanks,

Juliette

drizopoulos commented 1 year ago

Unfortunately, there is no functionality currently to compute that directly. You will indeed need to do it by hand.

JulietteOrtholand commented 1 year ago

Hi,

I computed it manually using simulated data but I found almost 2 times what I expected... Could you please confirm the following:

By default, using a longitudinal function phi(t) and no covariate, your hazard function is hazard(t) = h_0(t)exp(Bphi(t)), with h_0 modelled by gammas and B a fixed effect. Thus to get the median survival of the population using the patient with random effects equal to 0:

  1. I estimated the function h_0(t) which is a gamma function with 5 knots (by default) thanks to BSspline.
  2. I get the hazard function with the different parameters extracted from the summary of the survival and longitudinal function fit.
  3. I computed a primitive of the hazard, noted H with integrate.quad.
  4. I computed the survival function S(t) = exp(-H(t)) to get the value t that solves S(t) = 0.5.

Note that I use all the mean values of the fixed effects and gammas.