All event times are stopped at a given time point and corresponding events are censored
Event history object as obtained with
Time point at which to stop the event history object
Stopped event history object where all times are censored
stop.time. All observations with times greater than
are set to
stop.time and the event status is set to
A new column
"stop.time" is equal to
1 for stopped observations
and equal to
0 for the other observations.
Thomas A. Gerds <email@example.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
set.seed(29) d <- SimSurv(10) h <- with(d,Hist(time,status)) h stopTime(h,8) stopTime(h,5) ## works also with Surv objects library(survival) s <- with(d,Surv(time,status)) stopTime(s,5) ## competing risks set.seed(29) dr <- SimCompRisk(10) hr <- with(dr,Hist(time,event)) hr stopTime(hr,8) stopTime(hr,5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.