How to post process imputed data with 'survSplit' function

Viewed 45

When I do cox regression using R, I found the proporitonal hazard assumption is violated. So I decided to divide the data into different time intervals using the 'survSplit' function and calculate the HR for each time interval.

For example:

# 1) divide data into different time 
D1 <- survSplit(Surv(time, status) ~ ., data= data1, cut=c(40, 60),
episode= "tgroup", id="id")

# 2) to get HR for each time interval
coxph(Surv(tstart, time, status) ~ age + class:strata(tgroup), data=D1)

Now I want to do the same for multiply-imputed datasets (n=5).

# step 1 data imputation
imp <- mice(data1, seed = 12345, n=5,print = FALSE)

# step 2 reanalysis
fit <- with(imp, coxph(Surv(tstart, time, status) ~ age + class:strata(tgroup))

# step 3 pool the results
summary(pool(fit))

My question is how I can post process the imputed data to divide each imputed dataset into different time intervals using 'survSplit' between step 1 and step 2. After post processing, I can continue with step 2 and step3.

I can extract each imputed dataset and then divide it using 'survSplit'. But by doing so, I am not able to continue step2 and step 3 using the MICE package. Kindly help. Thanks.

0 Answers
Related