totlos.msm(x, start=1, fromt=0, tot=Inf, covariates="mean", ...)
msm
.t
must be specified."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,integrate
function to control the numerical
integration.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.
sojourn.msm
, integrate
.