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

David Winsemius dwinsemius at comcast.net
Mon Jan 23 06:49:59 CET 2017


> On Jan 22, 2017, at 10:30 AM, Andreu Ferrero <fromnorden at gmail.com> wrote:
> 
> Here is an example:
> 

Crossposting to stackoverflow and rhelp is deprecated. Read the Posting Guide. (And) Learn to ask the maintainer.

— 
David.
> 
> # 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]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Alameda, CA, USA



More information about the R-help mailing list