Description Usage Arguments Details Value Author(s) References See Also Examples
Estimation of state-specific and marginal life expectancies given
a multi-state survival model fitted using the msm-package
1 2 3 |
x |
Fitted |
b.covariates |
List with specified covariates values (ignore intercept) |
statedistdata |
Data used to estimate prevalence distribution of living states |
time.scale.msm |
Time scale in multi-state model: |
h |
Grid parameter for integration where scale is |
age.max |
Assumed maximum age in same time scale as in fitted model |
S |
Number of replications for estimation of uncertainty ( |
setseed |
Seed for the random number generation in the simulation |
RestrAndConst |
Vector which indexes the independent model parameters. Only
needed when |
statedist.covariates |
Names of covariates for model for prevalence distribution of living states |
method |
Approximation of integral: |
The elect-package is an add-on to the msm-package for models with one death state. In the msm call for fitting the model use center=FALSE, and names state and age. Do not use variables encoded as factor by R. Covariate age should be the first entry in b.covariates. The other covariates in b.covariates should follow the order
in the msm call. The life expectancies are computed by approximating the
integral numerically with a grid defined by h. The specification of statedist.covariates should
be a subset of b.covariates.
A list containing the following components:
pnt |
Life expectancies derived from MLE of model parameters |
sim |
Simulated life expectancies using the MLE of model parameters |
h |
As specified in |
covars |
Covariates as specified in |
S |
|
sd.model |
Fitted model for the prevalence distribution of living states |
Ardo van den Hout and Mei Sum Chan
Jackson, C.H. (2011). Multi-State Models for Panel Data: The msm Package for R., Journal of Statistical Software, 38(8), 1-29.
Van den Hout, A. (2017). Multi-State Survival Models for Interval-Censored Data. Boca Raton: CRC/Chapman & Hall.
1 2 3 4 5 6 7 8 9 10 11 12 | # Fit msm model:
Q <- rbind(c(0,0.01,0.01), c(0,0,0.01), c(0,0,0))
model <- msm(state~age, subject = id, data = electData,
center = FALSE, qmatrix = Q, deathexact = TRUE,
covariates = ~age+x)
# Estimate life expectancies:
sddata <- electData[electData$bsline == 1,]
LEs <- elect(x = model, b.covariates = list(age = 0, x = 0),
statedistdata = sddata, h = 0.5, age.max = 50, S = 25)
summary(LEs)
plot(LEs) # For smoother graphs, increase S
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.