Hi everyone, I am fitting a cox proportional hazard model with a continuous variable "x" as the covariate: fit<-coxph(Surv(time, status)~x) Now I wanted to make a plot of survival probability vs. the covariate, and the 95% confidence interval for the survival probability. It's just like a Kaplan-Meier Survival curve, except now the x axis represents the value of covariate, not the time. Someone gave me a reference to a paper in JASA by Gary (1992) for this type of plot, but I didn't have the access to the paper. So I am wondering if anyone knows how to do this in R or S-Plus? In addition, can anyone explain to me what are the following "type" options in predict.coxph() predicting? predict(fit,type='lp',se.fit=T) predict(fit,type='risk',se.fit=T) predict(fit,type='expected',se.fit=T) predict(fit,type='terms',se.fit=T) Thank you very much
Frank E Harrell Jr
2003-Dec-12 01:35 UTC
[R] Re: [S] plot of survival probability vs. covariate
On Thu, 11 Dec 2003 15:23:37 -0800 (PST) array chip <arrayprofile at yahoo.com> wrote:> Hi everyone, > > I am fitting a cox proportional hazard model with a > continuous variable "x" as the covariate: > > fit<-coxph(Surv(time, status)~x) > > Now I wanted to make a plot of survival probability > vs. the covariate, and the 95% confidence interval for > the survival probability. It's just like a > Kaplan-Meier Survival curve, except now the x axis > represents the value of covariate, not the time. > Someone gave me a reference to a paper in JASA by Gary > (1992) for this type of plot, but I didn't have the > access to the paper. So I am wondering if anyone knows > how to do this in R or S-Plus?This will get you started. Look into the documentation for confidence limits. library(Design) # if S-Plus do library(Hmisc,T);library(Design,T) dd <- datadist(yourdataframe) options(datadist='dd') f <- cph(Surv( ) ~ x1+x2, surv=T, x=T, y=T) plot(f, x1=NA, time=2) # plots 2-year survival Frank Harrell> > In addition, can anyone explain to me what are the > following "type" options in predict.coxph() > predicting? > > predict(fit,type='lp',se.fit=T) > predict(fit,type='risk',se.fit=T) > predict(fit,type='expected',se.fit=T) > predict(fit,type='terms',se.fit=T) > > > Thank you very much > > > > __________________________________ > Do you Yahoo!? > New Yahoo! Photos - easier uploading and sharing. > http://photos.yahoo.com/ > -------------------------------------------------------------------- > This message was distributed by s-news at lists.biostat.wustl.edu. To > ...(s-news.. clipped)...--- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
Possibly Parallel Threads
- survival package - calculating probability to survive a given time
- proportion of treatment effect by a surrogate (fitting multivariate survival model)
- Paik, et al., NEJM, 2004, Fig. 4, rate of event at 10 years as a function of covariate
- Plotting an adjusted survival curve
- cumulative incidence plot vs survival plot