简体   繁体   中英

Doing a one step Cox PH regression for 4 time intervals in R

I have 4 intervals of interest:

  • 0 - 30 days
  • 30 days - ½ year
  • ½ - 2 years
  • 2 years - 10 years

Right now I'm subsetting my dataset like this:

# Set time period
time_period.first <-  30/365.25
time_period.intermediate <- .5
....

# TREOP = Time in years
data.first = all_data
# Remove already censored data
data.intermediate = subset(data.first, data.first$TREOP > time_period.first)

# Set all outside as censored
data.first$RREOP[data.first$TREOP > time_period.first] = 0
data.first$TREOP[data.first$TREOP > time_period.first] = time_period.first

data.intermediate$RREOP[data.intermediate$TREOP > time_period.second] = 0
data.intermediate$TREOP[data.intermediate$TREOP > time_period.second] = time_period.second
....

I'm doing cox regression with the 'survival' package (I also use the cph in the 'Design' package for C-statistic calculations).

My question:

Is there a better way of performing this left-truncation & right-censoring?

Ideal would be:

# TREOP - time in years
# RREOP - event
surv <- Surv(TREOP, RREOP, start=30/365.25, stop=.5)

I've looked at the help and the time, time2 & type seem to do handle truncation but I think that it's for a more complex setting where subjects enter the study after 22 days and not for splitting data into intervals.

Edit

I've found the survSplit() function in the survival package but although it by description seems right I'm not sure how to tame it - the example doesn't really help me out. Anyone have any experience with it?

  1. I agree with right-censoring which looks simple and straightforward.
  2. I'm not sure that you should left-truncate. I would feel more comfortable leaving the shorter survival times unchanged and just increase the upper censoring limit. If the n'th time period is much longer than the (n-1)'th - it won't matter much and if it is not much longer than the shorter survival times shouldn't be truncated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM