predict.idm {SmoothHazard} | R Documentation |
Predict transition probabilities and cumulative probabilities from an object
of class idmSplines
with confidence intervals are calculated.
## S3 method for class 'idm' predict(object, s, t, newdata, nsim = 200, seed = 21, conf.int = 0.95, lifeExpect = FALSE, maxtime, ...)
object |
an |
s |
time point at which prediction is made. |
t |
time horizon for prediction. |
newdata |
A data frame with covariate values for prediction. |
nsim |
number of simulations for the confidence intervals calculations. The default is 200. |
seed |
Seed passed to |
conf.int |
Level of confidence, i.e., a value between 0 and 1,
the default is |
lifeExpect |
Logical. If |
maxtime |
The upper limit of integration for calculations of life expectancies from Weibull parametrizations. |
... |
other parameters. |
a list containing the following predictions with pointwise confidence intervals:
p00 |
the transition probability p_{00}. |
p01 |
the transition probability p_{01}. |
p11 |
the transition probability p_{11}. |
p12 |
the transition probability p_{12}. |
p02_0 |
the probability of direct transition from state 0 to state 2. |
p02_1 |
the probability of transition from state 0 to state 2 via state 1. |
p02 |
transition probability p_{02}. Note that
|
F01 |
the lifetime
risk of disease. |
F0. |
the probability of exit from state
0. |
R: Celia Touraine <Celia.Touraine@isped.u-bordeaux2.fr> and Thomas Alexander Gerds <tag@biostat.ku.dk> Fortran: Pierre Joly <Pierre.Joly@isped.u-bordeaux2.fr>
## Not run: set.seed(100) d=simulateIDM(n = 100) 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) ## End(Not run)