Got it. Thank you so much for the help!
Min Yi MD, PhD Department of Surgical Oncology - Unit 1484 1400 Pressler Street, #FCT17.6061 University of Texas M.D. Anderson Cancer Center P.O. Box 301402 Houston, TX 77230-1402 Phone: 713-563-1874 Fax: 713-792-4689 From: Frank Harrell [via R] [mailto:ml-node+s789695n4129173...@n4.nabble.com] Sent: Thursday, December 01, 2011 10:15 AM To: Yi,Min Subject: Re: Nomogram with stratified cph in rms package, how to get failure probability Hazard() is not implemented except for parametric survival models. You are not calling nomogram() correctly; in rms the plotting step is separated from the nomogram computations. To plot cumulative event rates do something like: mort10 <- function(lp) 1 - surv(10,lp) and tell nomogram about mort10 using fun=. Frank min wrote 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. Frank Harrell Department of Biostatistics, Vanderbilt University ________________________________ If you reply to this email, your message will be added to the discussion below: http://r.789695.n4.nabble.com/Nomogram-with-stratified-cph-in-rms-package-how-to-get-failure-probability-tp4123249p4129173.html To unsubscribe from Nomogram with stratified cph in rms package, how to get failure probability, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4123249&code=bXlpQG1kYW5kZXJzb24ub3JnfDQxMjMyNDl8MTkzMzMxNzE4Mg==>. NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> -- View this message in context: http://r.789695.n4.nabble.com/Nomogram-with-stratified-cph-in-rms-package-how-to-get-failure-probability-tp4123249p4129184.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.