s-news
[Top] [All Lists]

Re: instant hazard rate/survival

To: mcheang@mac.com
Subject: Re: instant hazard rate/survival
From: Terry Therneau <therneau@mayo.edu>
Date: Tue, 27 Sep 2005 08:22:22 -0500 (CDT)
Cc: s-news@lists.biostat.wustl.edu
Reply-to: Terry Therneau <therneau@mayo.edu>
 The simplest way that I know to get an estimate of the
 hazard is to use smoothing splines.
 
 fit <- survfit(Surv(time, status) ~ sex, data=lung)
 
 temp1 <- smooth.spline(fit[1]$time, 1-fit[1]$surv, df=5)
 temp2 <- smooth.spline(fit[2]$time, 1-fit[2]$surv, df=5)
 
 plot( predict(temp1, deriv=1), type='l')
 lines(predict(temp2, deriv=1), col=2)
 
 
------
  The lung cancer data set is part of Splus (it's used in several
 manual pages as an example).  The plot shows the males to have a 
 higher initial hazard than the females.
  
  You choice of 5 degrees of freedom for the spline was completely
arbitrary.

        Terry Therneau
        

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