I am confused when trying the function survfit. my question is: what does the survival curve given by plot.survfit mean? is it the survival curve with different covariates at different points? or just the baseline survival curve? for example, I run the following code and get the survival curve #### library(survival) fit<-coxph(Surv(futime,fustat)~resid.ds+rx+ecog.ps,data=ovarian) plot(survfit(fit,type="breslow")) summary(survfit(fit,type="breslow")) #### for the first two failure points, we have s(59|x1)=0.971, s(115|x2)=0.942 how can we guarantee that s(59|x1) is always greater than s(115|x2)? since s(59|x1)=s_0(59)^exp(\beta'x1) and s(115|x2)=s_0(115)^exp(\beta'x2), we can manipulate covariates to make s(59|x1) < s(115|x2), right? do I miss anything? thanks in advance Jeff -- View this message in context: http://www.nabble.com/survival%3A%3Asurvfit%2Cplot.survfit-tp22206954p22206954.html Sent from the R help mailing list archive at Nabble.com.
Jeff Xu wrote:> I am confused when trying the function survfit. > my question is: what does the survival curve given by plot.survfit mean? > is it the survival curve with different covariates at different points? > or just the baseline survival curve? > > for example, I run the following code and get the survival curve > > #### > library(survival) > fit<-coxph(Surv(futime,fustat)~resid.ds+rx+ecog.ps,data=ovarian) > plot(survfit(fit,type="breslow")) > summary(survfit(fit,type="breslow")) > #### > > for the first two failure points, we have s(59|x1)=0.971, s(115|x2)=0.942 > how can we guarantee that s(59|x1) is always greater than s(115|x2)? > since s(59|x1)=s_0(59)^exp(\beta'x1) and s(115|x2)=s_0(115)^exp(\beta'x2), > we can manipulate covariates to make s(59|x1) < s(115|x2), right? > do I miss anything?In advance: I?m a beginner in survival analysis, too. But I think I can help you with this. plot(survfit(fit)) should plot the survival-function for x=0 or equivalently beta'=0. This curve is independent of any covariates. If you want to see the impact of residual-status=2 you could add something like: attach(ovarian) ovarian_new <- data.frame(resid.ds=2, rx=(mean(rx)),ecog.ps=mean(ecog.ps)) detach() plot(survfit(fit), newdata=ovarian_new) This should give you the survival-function for an average patient with residual-status 2. Regards Bernhard
> plot(survfit(fit)) should plot the survival-function for x=0 or > equivalently beta'=0. This curve is independent of any covariates.This is not correct. It plots the curve for a hypothetical subject with x= mean of each covariate. This is NOT the "average survival" of the data set. Imagine a cohort made up of 60 year old men and their 10 year old grandsons: the expected survival of this cohort does not look that for a 35 year old male. Terry T
--- begin included message ---- #Two models coxsst4 <- coxph(Surv(schaeden)~ S5, data=nino4) coxsst4_full <- coxph(Surv(schaeden)~ 0+S1+S2+S3+S4+S5+S6+S7+S8+S9+S10, data=nino4) #Set all covariates 0 attach(nino4) newS4 <- data.frame(S0=0., S1=0., S2=0., S3=0., S4=0., S5=0., S6=0., S7=0., S8=0., S9=0., S10=0.) detach() new_surv1 <- survfit(coxsst4, newdata=newS4) new_surv2 <- survfit(coxsst4_full, newdata=newS4) Yields two different curves. What did I get wrong? ---- end inclusion ---------- You did nothing wrong. As I have said before, the survival curve from a Cox model is always for a particular hypothetical subject with a particular choice of covariates: there is nothing special (nil, nada, zip, NOTHING) about a covariate choice of zero. There is no such thing as "the" baseline survival curve. 1. Imagine someone sabotaged your data set by replacing S1 with S1+6. None of the Cox model coefficients or inferences would change, but "0" is now someone quite different than before. 2. Consider the linear models fit1 <- lm(pat.karno ~ age, data=lung) fit2 <- lm(pat.karno ~ age + sex, data=lung) They have different predicted values for the hypothethical subject with age=sex=0. (A subject with age=0 sex=0 is not particularly interesting of course, but then coxph survival curves for all covariates=0 are about the same.) A baseline curve for all zeros is essentially an intercept term, and since it depends on what other covariates were or were not in the model is not useful on its own. Terry Therneau