# predict.idm: Predictions for an illness-death model using either a... In SmoothHazard: Estimation of Smooth Hazard Models for Interval-Censored Data with Applications to Survival and Illness-Death Models

## Description

Predict transition probabilities and cumulative probabilities from an object of class `idmSplines` with confidence intervals are calculated.

## Usage

 ```1 2 3``` ```## S3 method for class 'idm' predict(object, s, t, newdata, nsim = 200, seed = 21, conf.int = 0.95, lifeExpect = FALSE, maxtime, ...) ```

## Arguments

 `object` an `idm` class objects returned by a call to the `idm` function `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 `set.seed` for Monte Carlo simulation of confidence intervals. `conf.int` Level of confidence, i.e., a value between 0 and 1, the default is `0.95`. The default is also used when `conf.int=TRUE`. To avoid computation of confidence intervals, set `conf.int` to FALSE or NULL. `lifeExpect` Logical. If `TRUE` compute life expectancies, i.e., `t=Inf`. `maxtime` The upper limit of integration for calculations of life expectancies from Weibull parametrizations. `...` other parameters.

## Value

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 `p02`=`p_02_0`+`p02_1`. `F01` the lifetime risk of disease. `F01`=`p01`+`p02_1`. `F0.` the probability of exit from state 0. `F0.`=`p02_0`+`p01`+`p02_1`.

## Author(s)

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>

`idm`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30``` ```## 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) ```