atj409
2014-03-27
Hi, I am running a parametric survival analysis using a Log-normal model. I know that other programs (Stata, SPSS) have specific ways to implement time-varying predictors, as well as predictors whose strength changes over time (modeled by an interaction of that predictor with time). Any suggestions on how this might be done in JAGS? In looking at my code, all lines can be effectively ignored, except for the one that deterministically defines log(mu[i]) as a function of the predictors. There must be a way to model time-varying covariates (and I've tried/read a lot of things), but I cannot figure out how.
model{ #Likelihood for (i in 1:241){ Censor[i] ~ dinterval(SurvTime.NA[i], SurvTime[i]) SurvTime.NA[i] ~ dlnorm(mu[i], tau)T(TruncTime[i], ) log(mu[i]) <- alpha + b1*x[i]+b2*x2[i] } #Priors tau~dunif(.0001, 10000) alpha ~ dnorm(0, .0001) b1 ~ dnorm(0, .0001) b2 ~ dnorm(0, .0001) }
Martyn Plummer
2014-03-27
This is an accelerated life model, which does not lend itself to time-varying covariates. Under the accelerated life model, time passes at a faster rate for those who are exposed to some risk factor, compared to those who are unexposed. When you look at time on a log scale, the distribution of failure times is the same in exposed vs unexposed, but is shifted by a constant amount (depending on the strength of the risk). In your example, the log failure time has a normal distribution with the same variance but different mean depending on the covariate values. This preservation of the distributional form requires constant covariates.
If you do want time-varying covariates, then you need to use the proportional hazards model. The "leuk" example from the OpenBUGS manual shows you how to fit a Cox model (with arbitrarily varying baseline hazard).
http://mathstat.helsinki.fi/openbugs/Examples/Leuk.html
You can adapt this example to your case by replacing Z[i]
, the covariate value of individual i
, with Z[i,j]
, the value for i
at time j
.
atj409
2014-03-28
What makes it an accelerated model? I didn't intend for that type of model and got the code by reading about the log-normal parametric model in the beginning of Ibrahim et al.'s "Bayesian Survival Analysis" book. Since 'the presence of the distributional form requires constant covariates,' does that imply that all parametric survival regression models preclude time-varying covariates? (your last sentence seems to imply that I can add these in with relative ease...)
I did consider a Cox model, but the code (and counting process formulation) was a bit daunting and I was left wondering how anything non-parametric is fit in a Bayesian JAGS model. I may turn to it, but my survival times are log-normal, and I have only have experience fitting parametric Bayesian models.
You say that I can replace each single unchanging covariate value z[i] with z[i,j]. Does this that it would be predicting log(mu[i,j]) instead of just log(mu[i])?
Thank you very much for your response/input. It is truly appreciated.