# \donttest{
set.seed(100)
d=simulateIDM(n = 200)
fit <- idm(formula01=Hist(time=list(L,R),event=seen.ill)~X1+X2+X3,
formula02=Hist(time=observed.lifetime,event=seen.exit)~X1+X2+X3,
data=d,conf.int=FALSE)
predict(fit,s=0,t=80,conf.int=FALSE,lifeExpect=FALSE)
predict(fit,s=0,t=80,nsim=4,conf.int=TRUE,lifeExpect=FALSE)
predict(fit,s=0,t=80,nsim=4,conf.int=FALSE,lifeExpect=TRUE)
data(Paq1000)
library(prodlim)
fit.paq <- idm(formula02=Hist(time=t,event=death,entry=e)~certif,
formula01=Hist(time=list(l,r),event=dementia)~certif,data=Paq1000)
predict(fit.paq,s=70,t=80,newdata=data.frame(certif=1))
predict(fit.paq,s=70,lifeExpect=TRUE,newdata=data.frame(certif=1))
fit.splines <- idm(formula02=Hist(time=t,event=death,entry=e)~certif,
formula01=Hist(time=list(l,r),event=dementia)~certif,
formula12=~1,
method="Splines",
data=Paq1000)
predict(fit.splines,s=70,t=80,newdata=data.frame(certif=1))
predict(fit.splines,s=70,t=80,lifeExpect=TRUE,newdata=data.frame(certif=1),nsim=20)
# }
Run the code above in your browser using DataLab