prevalence.msm(x, times=NULL, timezero=NULL, initstates=NULL, covariates="mean",
misccovariates="mean", piecewise.times=NULL, piecewise.covariates=NULL,
ci=c("none","normal","bootstrap"), cl=0.95, B=1000,
interp=c("start","midpoint"), plot=FALSE)
msm
.qmatrix.msm
. Defaults to the
mean values of the covariates in the data set.pmatrix.piecewise.msm
for how
to specify this.pmatrix.piecewise.msm
for how
to specify this."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 covar If interp="start"
, then individu
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.
Note that this function assumes intensities are the same for all
individuals. By default they are taken from the mean values of the
covariates in the population. Piecewise-constant intensities may be
assumed, through the arguments piecewise.times
and
piecewise.covariates
.
For an example of this approach, see Gentleman et al. (1994).
msm
, summary.msm