[R] Nomogram with stratified cph in rms package, how to get failure probability

min myi at mdanderson.org
Wed Nov 30 15:47:29 CET 2011


Hello,

I am using Dr. Harrell's rms package to make a nomogram. I was able to make
a beautiful one. However, I want to change 5-year survival probability to
5-year failure probability.

I couldn’t get hazard rate from Hazard(f1) because I used cph for the model.

Here is my code:

 library(rms)
f1 <- cph(Surv(retime,dfs) ~
age+her2+t_stage+n_stage+er+grade+cytcyt+Cyt_PCDK2  , data=data11,
surv=T, x=T, y=T, time.inc=5)

surv<- Survival(f1)
haz<- Hazard(f1)
Here is the Error in UseMethod("Hazard") :
  no applicable method for 'Hazard' applied to an object of class "c('cph',
'Design', 'coxph')"


surv10 <- function(lp) surv(10,lp)
surv5 <- function(lp) surv(5,lp)
quant <- Quantile(f1)

at.surv <- c(0.1, 0.3, 0.5,  0.7, 0.9)

at.med1<-c(2,3,4, 5,6,7,8, 10,15,20,25, 30)


par(cex=0.8)
nom<- nomogram(f1, conf.int=F,
fun=list(surv5, surv10), funlabel=c('5-Year Survival Probability', '10-Year
Survival Probability' ),  lp=F,
fun.at=c(at.surv, at.surv),label.every=1, force.label=FALSE, cex.axis=0.8,
verbose=TRUE, cex.var=0.8)

How can I show failure probability instead of survival probability? 

I would very much appreciate any assistance in this matter.
Thank you Very much.


--
View this message in context: http://r.789695.n4.nabble.com/Nomogram-with-stratified-cph-in-rms-package-how-to-get-failure-probability-tp4123249p4123249.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list