[R] predicting cumulative hazard for coxph using predict
Terry Therneau
therneau at mayo.edu
Tue Feb 24 17:23:32 CET 2009
> I am estimating the following coxph function with stratification and
> frailty, where each person had multiple events.
> m <- coxph(Surv(dtime1,status1) ~ gender +cage +uplf+ strata(enum)+
> frailty(id), xmodel)
>I want to predict the cumulative hazard for each person for their next event at
> a given time in future.What is the best way to compute it?
There are two issues. The first is that what you are asking for -- it is not
at all clear to me exactly how this should be computed, and as a consequence the
coxph routines/documentation are not clear. When there is a random effect in
the model, should the baseline hazard be computed before or after integrating
out the random effect? How should one define the cumulative hazard for a
subject? These are hard questions, or at least I've found them so.
What is currently done: The basline hazard is computed treating each of the
fitted random effects (one per id) as it if were a known fixed value. The
predict function treats the random effects as just another coefficient, which is
clearly the wrong thing to do wrt a new subject who was not in the original data
set.
If you think of the frailty term as a shrinkage estimator, with no particular
connection to random effects, then what is currently done makes reasonable
sense. The "random effects" are just more coefficients in the model.
Terry Therneau
More information about the R-help
mailing list