[R] Kaplan-Meier for left truncated data?

gb gb at stat.umu.se
Fri May 26 08:37:08 CEST 2000


On Fri, 26 May 2000, Fredrik Lundgren wrote:

> R-users!
> 
> How do I ask for the 'baseline hazard' of a coxph fit??

This interesting:

> start <- c(1,2,1,1)
> stopp <- c(3,4,5,6)
> event <- c(1,1,1,1)
> library(survival5)
> survfit(Surv(start, stopp, event))
Error in survfit.km(X, Y, casewt, ...) : Can only handle right censored
data

Does not work :-(

> res <- coxph(Surv(start, stopp, event) ~ 1)
> survfit(res)

Is ok! :-)

Göran

> 
> Fredrik Lundgren
> ----- Ursprungligt meddelande ----- 
> Från: "gb" <gb at stat.umu.se>
> Till: <r-help at stat.math.ethz.ch>
> Skickat: den 25 maj 2000 21:25
> Ämne: Re: [R] Kaplan-Meier for left truncated data?
> 
> 
> > 
> > I have got two late answers to this question, from Mai Zhou and Bendix
> > Carstensen. Both point out a 'trick': Use  coxph  to fit a model with
> > no covariates and ask for the 'baseline hazard' of that fit!  
> > Unlike  survfit,  coxph  allows for left truncated data.
> > 
> > Thanks to both!
> > 
> > Göran
> > 
> > > On Sun, 21 May 2000, gb wrote:
> > > 
> > > > 
> > > > Is there a function somewhere for estimating the survivor function
> > > > (plus confidence limits) when data are both left truncated and right
> > > > censored?  survfit in  survival5  doesn't like left truncation.
> > 
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> > Send "info", "help", or "[un]subscribe"
> > (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
> 

-- 
 Göran Broström, professor           tel: +46 90 786 5223
 Department of Statistics            fax: +46 90 786 6614
 Umeå University
 SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list