prevalence.msm(x, times=NULL, timezero=NULL, initstates=NULL, covariates="population",
misccovariates="mean", piecewise.times=NULL, piecewise.covariates=NULL,
ci=c("none","normal","bootstrap"), cl=0.95, B=1000, cores=NULL,
interp=c("start","midpoint"), censtime=Inf, subset=NULL, plot=FALSE, ...)
msm
.covariates="population"
,
expected prevalences are produced by summing model predictions over
the covariates observed in the original data, for a facovariates="population"
, otherwise
defaults to the meanpmatrix.piecewise.msm
for how
to specify this. Ignored if covariates="population"
.
This is only required forpmatrix.piecewise.msm
for how
to specify this. Ignored if covariates="population"
."normal"
, then calculate a confidence interval for
the expected prevalences by simulating B
random vectors
from the asymptotic multivariate normal distribution implied by the
maximum likelihood estimates (and covarboot.msm
for more details. If interp="start"
, then individu
censtime
and the
patient has reached an absorbing state, then that subject will be
removed from the risk set. For example, if patients have died but
would only have been observed up to this time, thplot.prevalence.msm
plot.prevalence.msm
.ci.boot = TRUE
, the component Expected
is a list
with components estimates
and ci
.
estimates
is a matrix of the expected prevalences, and
ci
is a list of two matrices, containing the confidence limits.
The component
Expected percentages
has a similar format. For misclassification models (fitted using an ematrix
), this
aims to assess the fit of the full model for the observed
states. That is, the combined Markov progression model for the true
states and the misclassification model. Thus, expected prevalences of true
states are estimated from the assumed proportion
occupying each state at the initial time using the fitted transition
probabiliy matrix. The vector of expected prevalences of true states
is then multiplied by the fitted misclassification probability matrix
to obtain the expected prevalences of observed states.
For general hidden Markov models, the observed state is taken to be the
predicted underlying state from the Viterbi algorithm
(viterbi.msm
). The goodness of fit of
these states to the underlying Markov model is tested.
For an example of this approach, see Gentleman et al. (1994).
Titman, A.C., Sharples, L. D. Model diagnostics for multi-state models. Statistical Methods in Medical Research (2010) 19(6):621-651.
msm
, summary.msm