lifexpect: Predictions of life expectancies from an illness-death.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lifexpect.R

Description

Predict life expectancies from an object of class idm. Life expectancies are calculated at time s for a subject who has the covariates values Z01, Z02, Z12. Confidence intervals are calculated.

Usage

1
lifexpect(x, s, Z01, Z02, Z12, nsim = 1000, CI = TRUE, ...)

Arguments

x

an object as returned by a call to the idm function.

s

time at prediction.

Z01

vector for the values of the covariates on the transition 0 –> 1 (in the same order as the covariates within the call. The default values are all 0.

Z02

vector for the values of the covariates on the transition 0 –> 2 (in the same order as the covariates within the call. The default values are all 0.

Z12

vector for the values of the covariates on the transition 1 –> 2 (in the same order as the covariates within the call. The default values are all 0.

nsim

number of simulations for the confidence intervals calculations. The default is 1000.

CI

boolean: with (TRUE) or without (WRONG) confidence intervals for the life expectancies. The default is TRUE.

...

others arguments.

Value

a list containing:

life.in.0.expectancy

life expectancy in state 0 and confidence interval.

life.expectancy.nondis

life expectancy of a non-diseased subject and confidence interval.

life.expectancy.dis

life expectancy of a diseased subject and confidence interval.

Author(s)

C. Touraine

See Also

idm

Examples

 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
## Not run: 
library(lava)
library(prodlim)
set.seed(17)
d <- simulateIDM(100)
table(d$seen.ill,d$seen.exit)
fitIC <- idm(formula01=Hist(time=list(L,R),event=seen.ill)~X1+X2,
             formula02=Hist(time=observed.lifetime,event=seen.exit)~X1+X2,
             formula12=Hist(time=observed.lifetime,event=seen.exit)~X1+X2,data=d,
             conf.int=FALSE)
try(lifexpect(fitIC,s=10),silent=TRUE)


    data(Paq1000)

    fit <- idm(formula02=prodlim::Hist(time=t,event=death,entry=e)~certif,
               formula01=prodlim::Hist(time=list(l,r),event=dementia)~certif,
               method="Splines",
               data=Paq1000,
               conf.int=FALSE)

    pred <- lifexpect(fit,s=70,t=80,Z01=c(1),Z02=c(1),Z12=c(1))


## End(Not run)

SmoothHazard documentation built on May 2, 2019, 4:43 p.m.