totlos.msm {msm}R Documentation

Total length of stay

Description

Estimate the expected total length of stay in each set of states, for a given period of evolution of a multi-state model.

Usage

totlos.msm(x, start=1, end=NULL, fromt=0, tot=Inf, covariates="mean",
           ci=c("none","normal","bootstrap"), cl=0.95, B=1000, ...)

Arguments

x

A fitted multi-state model, as returned by msm.

start

State at the beginning of the period.

end

States to forecast the total length of stay in. Defaults to all states.

fromt

Time from which to estimate total length of stay. Defaults to 0, the beginning of the process.

tot

Time up to which total length of stay is estimated. Defaults to infinity, giving the expected time spent in the state until absorption. For models without an absorbing state, t must be specified.

covariates

The covariate values to estimate for. This can either be:

the string "mean", denoting the means of the covariates in the data (this is the default),

the number 0, indicating that all the covariates should be set to zero,

or a list of values, with optional names. For example

list (60, 1)

where the order of the list follows the order of the covariates originally given in the model formula, or a named list,

list (age = 60, sex = 1)

ci

If "normal", then calculate a confidence interval by simulating B random vectors from the asymptotic multivariate normal distribution implied by the maximum likelihood estimates (and covariance matrix) of the log transition intensities and covariate effects, then calculating the total length of stay for each replicate.

If "bootstrap" then calculate a confidence interval by non-parametric bootstrap refitting. This is 1-2 orders of magnitude slower than the "normal" method, but is expected to be more accurate. See boot.msm for more details of bootstrapping in msm.

If "none" (the default) then no confidence interval is calculated.

cl

Width of the symmetric confidence interval, relative to 1

B

Number of bootstrap replicates

...

Further arguments to be passed to the integrate function to control the numerical integration.

Details

The expected total length of stay in state j between times t_1 and t_2, from the point of view of an individual in state i at time 0, is defined by the integral from t_1 to t_2 of the i,j entry of the transition probability matrix P(t). As the individual entries of P(t) = exp(tQ) are not available explicitly in terms of t for a general Markov model, this integral is calculated numerically, using the integrate function. This may take a long time for models with many states where P(t) is expensive to calculate.

For a model where the individual has only one place to go from each state, and each state is visited only once, for example a progressive disease model with no recovery or death, these are equal to the mean sojourn time in each state. However, consider a three-state health-disease-death model with transitions from health to disease, health to death, and disease to death, where everybody starts healthy. In this case the mean sojourn time in the disease state will be greater than the expected length of stay in the disease state. This is because the mean sojourn time in a state is conditional on entering the state, whereas the expected total time diseased is a forecast for a healthy individual, who may die before getting the disease.

The only time-inhomogeneous models handled by this function are those specified using the pci option to msm. For any other inhomogeneous models, the function assumes that covariates are constant on the forecasted interval.

Value

A vector of expected total lengths of stay for each transient state.

Author(s)

C. H. Jackson chris.jackson@mrc-bsu.cam.ac.uk

See Also

sojourn.msm, pmatrix.msm, integrate, boot.msm.


[Package msm version 1.1.4 Index]