Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-26 Thread Göran Broström
The functions 'age.window' and 'cal.window' in the package 'eha' are designed to perform 'rectangular cuts' in the Lexis diagram. So, in your case, require(eha) dat <- data.frame(enter = rep(0, length(Survival_days), exit = Survival_days, event = Outcome) dat.1 <- age.window(dat, c(0, 2190))

Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-21 Thread Andrews, Chris
xxx) # impose earlier stop time? tstop <- 2 lines(survfit(Surv(ttt) ~ xxx, subset=tttmailto:dwinsem...@comcast.net] Sent: Wednesday, November 20, 2013 5:49 PM To: Dr.Vinay Pitchika Cc: r-help@r-project.org Subject: Re: [R] How to stop Kaplan-Meier curve at a time point On Nov 20, 2013, at 1

Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-21 Thread David Winsemius
top) > > lines(survfit(Surv(ttt2, ddd) ~ xxx), col=3) > survdiff(Surv(ttt2, ddd) ~ xxx) > # green lines match black lines up to tstop > > > > > -Original Message- > From: David Winsemius [mailto:dwinsem...@comcast.net] > Sent: Wednesday, November 20, 201

Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-21 Thread Terry Therneau
Here is the simplest answer that I know. outcome6 <- ifelse(Survival_days > 2190, 0, Outcome) survfit(Surv(Survival_days, outcome6) ~ Gender) This assumes that the variable Outcome is coded as 0/1. If it were instead FALSE/TRUE then change the 0 to "FALSE" in the first line. The logrank

Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-20 Thread Thomas Stewart
One solution is to format the data as if the follow-up period ended on day 2190. For example, TTT <- Survival_days DDD <- Outcome DDD[ TTT>2190 ] <- 0 TTT[ TTT>2190 ] <- 2190 survfit(Surv(TTT, DDD) ~ Gender) -tgs On Wed, Nov 20, 2013 at 3:01 PM, Dr.Vinay Pitchika wrote: > Hello R users > >

Re: [R] How to stop Kaplan-Meier curve at a time point

2013-11-20 Thread David Winsemius
On Nov 20, 2013, at 12:01 PM, Dr.Vinay Pitchika wrote: > Hello R users > > I have a question with Kaplan-Meier Curve with respect to my research. We > have done a retrospective study on fillings in the tooth and their survival > in relation to the many influencing factors. We had a long follow-u

[R] How to stop Kaplan-Meier curve at a time point

2013-11-20 Thread Dr.Vinay Pitchika
Hello R users I have a question with Kaplan-Meier Curve with respect to my research. We have done a retrospective study on fillings in the tooth and their survival in relation to the many influencing factors. We had a long follow-up time (upto 8yrs for some variables). However, we decided to stop