s-news
[Top] [All Lists]

Re: Confidence interval for survival function

To: tristan.lorino@lcpc.fr
Subject: Re: Confidence interval for survival function
From: Terry Therneau <therneau@mayo.edu>
Date: Tue, 20 May 2008 09:25:47 -0500 (CDT)
Cc: s-news@lists.biostat.wustl.edu
Reply-to: Terry Therneau <therneau@mayo.edu>
 >
 >Hi,
 >
 >I try to plot on the same graph three survival functions (KM, Weibull
 >and Cox) with their confidence intervals:
 >
 >> weibfit_survReg(Surv(time,status)~1, data=Cens)
 >> coxfit <- coxph(Surv(time,status) ~ 1, data=Cens)
 >> x_seq(0,10,by=.3)
 >> plot(survfit(Surv(time,status), data=Cens),ylim=c(.4,1))
 >> points(survfit(coxfit), type="l",col=2)
 >> points(x,1-pweibull(x, 1/weibfit$scale, exp(coef(weibfit))),type="l",col=3)
 >
 >Is there a simple way to obtain CI for Weibull and Cox survival
 >curves? Conf.type and conf.int options do not change the output.
 >
 >Thanks in advance,
 >
 >Tristan Lorino
 >


 For the Cox model fit, use lines() instead of points().  help(lines.survfit) 
will list the appropriate arguments.
 
  For the Weibull, it's easiest to use inverse prediction:
  
  > prob <- seq(.05, .95, length=50)
  > temp <- predict(weibfit, type='quantile', p=prob, se.fit=T,                 
        
                newdata=Cens[1,])
  > matlines(cbind(temp$fit, temp$fit +1.96*temp$se,
                   temp$fit - 1.96*temp$se),  1-prob, 
                   lty=c(1,2,2), col=4)
  
  
        Terry Therneau             

        Terry Therneau


<Prev in Thread] Current Thread [Next in Thread>