[R] predicting cumulative hazard for coxph using predict

Zainab Jamal zainab_jamal at yahoo.com
Tue Feb 24 00:23:35 CET 2009


Hi
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)
 
> head(xmodel)
       id enum        dtime status gender     cage uplf
1 1008666    1 2259.1412037      1     MA    0.000    0
2 1008666    2   36.7495023      1     MA 2259.141    0
3 1008666    3    0.3026852      1     MA 2295.891    0
4 1008666    4   46.7493287      1     MA 2296.193    0
5 1008666    5   61.9772917      1     MA 2342.943    0
6 1008666    5  100.9964815      1     MA 2404.920    0


If I estimate predict(m,newdata,type="lp") does the output include xbeta or does it include xbeta+frailty term?
 
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? 

Currently I am doing it by pulling the different elements and putting them together using my own code.
For example, I get the cumulative baseline hazard from the basehaz function
bh<-basehaz(m)
bh$hazard for the strata in which the predicted event is and the time that matches to the prediction time.
xbeta from predict function
xbeta<-predict(m,newdata,type="lp")
fval<-m$frail 

Regards
Zainab 




More information about the R-help mailing list