Dear all, I have data from 1970 to 1990 for people above age 50. Now I want to calculate survival curves by age starting at age 50 using the Kaplan Meier Estimator. The problem I have is that there are already people in 1970 who are older than 50 years. I guess this is called delayed entry or left truncation (?). I thought the code would be: roland <- survfit(Surv(time=age.enter, time2=age.exit, event=status, type="interval")~1, weights=gewicht, type="kaplan-meier") But then R tells me that it can handle only right-censored or counting data. Is there another function which allows me to calculate the Kaplan Meier estimator? Thanks, Roland +++++ This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.
On Wed, Jan 07, 2004 at 12:57:46PM +0100, Rau, Roland wrote:> Dear all, > > I have data from 1970 to 1990 for people above age 50. > Now I want to calculate survival curves by age starting at age 50 using the > Kaplan Meier Estimator. > The problem I have is that there are already people in 1970 who are older > than 50 years. > I guess this is called delayed entry or left truncation (?). > > I thought the code would be: > > roland <- survfit(Surv(time=age.enter, time2=age.exit, event=status, > type="interval")~1, weights=gewicht, > type="kaplan-meier")Not type = "interval", but "count" (or just leave it out) You can also use 'plot.Surv' in package 'eha' (for plotting). -- G?ran Brostr?m tel: +46 90 786 5223 Department of Statistics fax: +46 90 786 6614 Ume? University http://www.stat.umu.se/egna/gb/ SE-90187 Ume?, Sweden e-mail: gb at stat.umu.se
On Wed, 7 Jan 2004, Rau, Roland wrote:> Dear all, > > I have data from 1970 to 1990 for people above age 50. > Now I want to calculate survival curves by age starting at age 50 using the > Kaplan Meier Estimator. > The problem I have is that there are already people in 1970 who are older > than 50 years. > I guess this is called delayed entry or left truncation (?).Yes> I thought the code would be: > > roland <- survfit(Surv(time=age.enter, time2=age.exit, event=status, > type="interval")~1, weights=gewicht, > type="kaplan-meier") > > But then R tells me that it can handle only right-censored or counting data.The `interval' type is for interval-censored data. Left-truncated, right-censored data are so easy to handle with hazard-based models that they are the default. You want roland <- survfit(Surv(age.enter, age.exit, status)) -thomas Thomas Lumley Assoc. Professor, Biostatistics tlumley at u.washington.edu University of Washington, Seattle