[R] Can mice() handle crr()? Fine-Gray model, Object has no vcov() method.

Andreu Ferrero fromnorden at gmail.com
Sun Jan 22 17:30:33 CET 2017


Here is an example:


# example

library(survival)
library(mice)
library(cmprsk)

test1 <- as.data.frame(list(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)))

dat <- mice(test1,m=10)

#Cox regression: cause 1

models.cox1 <- with(dat,coxph(Surv(time, status==1) ~ x +sex
))

summary(pool(models.cox1))

#Cox regression: cause 1 or 2

models.cox <- with(dat,coxph(Surv(time, status==1 | status==2) ~ x +sex
))
models.cox
summary(pool(models.cox))


# crr()

#Fine-Gray model

models.FG<- with(dat,crr(ftime=time, fstatus=status,  cov1=test1[,c(
"x","sex")], failcode=1, cencode=0, variance=TRUE))

summary(pool(models.FG))

#Error in pool(models.FG) : Object has no vcov() method.

models.FG




-- 
Andreu Ferrero Gregori

	[[alternative HTML version deleted]]



More information about the R-help mailing list