Skip to content

Can mice() handle crr()? Fine-Gray model

1 message · Terry Therneau

#
Look at the finegray command within the survival package; the competing risks vignette has 
coverage of it.  The command creates an expanded data set with case weights, such that 
coxph() on the new data set = the Fine Gray model for the original data.  Anything that 
works with coxph is valid on the new data.  Caveat -- I don't know mice() well at all: the 
dat1 data set below has multiple observations per subject, should the mice() command be 
cognizant of this?

Terry Therneau


library(survival)
library(mice)

test1 <- data.frame (time=c(4,3,1,1,2,2,3,5,2,4,5,1,
                             4,3,1,1,2,2,3,5,2,4,5,1),
                      status=c(1,1,1,0,2,2,0,0,1,1,2,0,
                               1,1,1,0,2,2,0,0,1,1,2,0),
                      x=c(0,2,1,1,NA,NA,0,1,1,2,0,1,
                          0,2,1,1,NA,NA,0,1,1,2,0,1),
                      sex=c(0,0,0,NA,1,1,1,1,NA,1,0,0,
                            0,0,0,NA,1,1,1,1,NA,1,0,0)))

# Endpoint 1, simple, then with mice
fit0 <- copxh(Surv(time, status==1) ~ sex + x, test1)
dat0 <- mice(test1, m=10)
mfit0 <- with(dat0, coxph(Surv(time, status==1) ~ sex + x))
summary(pool(mfit0))

# Endpoint 1, Fine-Gray model
fg1 <- finegray(Surv(time, factor(status)) ~ ., data=test1, etype=1)
fit1 <- coxph(Surv(fgstart, fgstop, fgstatus) ~ sex + x, data=fg1,
               weight= fgwt)

dat1 <- mice(fg1, m=10)
mfit1 <- with(dat1, coxph(Surv(fgstart, fgstop, fgstatus) ~ sex + x,
                          weight=fgwt))
On 01/23/2017 05:00 AM, r-help-request at r-project.org wrote: