Learn R Programming

msm (version 0.7.6)

plot.prevalence.msm: Plot of observed and expected prevalences

Description

Provides a rough indication of goodness of fit of a multi-state model, by estimating the observed numbers of individuals occupying a state at a series of times, and plotting these against forecasts from the fitted model, for each state. Observed prevalences are indicated as solid lines, expected prevalences as dashed lines.

Usage

plot.prevalence.msm(x, mintime=NULL, maxtime=NULL, timezero=NULL,
                    initstates=NULL, interp=c("start","midpoint"),
                    covariates="mean", misccovariates="mean",
                    piecewise.times=NULL, piecewise.covariates=NULL, ...)

Arguments

x
A fitted multi-state model produced by msm.
mintime
Minimum time at which to compute the observed and expected prevalences of states.
maxtime
Maximum time at which to compute the observed and expected prevalences of states.
timezero
Initial time of the Markov process. Expected values are forecasted from here. Defaults to the minimum of the observation times given in the data.
initstates
Optional vector of the same length as the number of states. Gives the numbers of individuals occupying each state at the initial time, to be used for forecasting expected prevalences. The default is those observed in the data. These should ad
interp
Interpolation method for observed states, see prevalence.msm
covariates
Covariate values for which to forecast expected state occupancy. See qmatrix.msm. Defaults to the mean values of the covariates in the data set.
misccovariates
(Misclassification models only) Values of covariates on the misclassification probability matrix for which to forecast expected state occupancy. Defaults to the mean values of the covariates in the data set.
piecewise.times
Times at which piecewise-constant intensities change. See pmatrix.piecewise.msm for how to specify this.
piecewise.covariates
Covariates on which the piecewise-constant intensities depend. See pmatrix.piecewise.msm for how to specify this.
...
Further arguments to be passed to the generic plot function.

Value

    Details

    See prevalence.msm for details of the assumptions underlying this method.

    References

    Gentleman, R.C., Lawless, J.F., Lindsey, J.C. and Yan, P. Multi-state Markov models for analysing incomplete disease history data with illustrations for HIV disease. Statistics in Medicine (1994) 13(3): 805--821.

    See Also

    prevalence.msm