Learn R Programming

msm (version 0.1)

prevalence.msm: Calculate tables of observed and expected prevalences at a series of times

Description

This function is called by summary.msm, and can provide a rough indication of the goodness of fit of a multi-state model without misclassification.

Usage

prevalence.msm(msm, times, timezero=min(time), initstates)

Arguments

msm
A fitted multi-state model without misclassification, produced by msm. The data for the fitted model must originally have been provided as a series of states and observation times, not in 'from-stat
times
Series of times 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. The default is that all individuals are in state 1 at timezero.

Value

  • A list with components: Observed = table of observed numbers of individuals in each state at each time

    Observed percentages = corresponding percentage of the individuals at risk at each time

    Expected = table of corresponding expected numbers

    Expected percentages = corresponding percentage of the individuals at risk at each time.

Details

For models without misclassification only. To compute `observed' prevalences at a time $t$, individuals are assumed to be in the same state as at their last observation time preceding $t$.

The fitted transition probability matrix is used to forecast expected prevalences from the state occupancy at the initial time. To produce the expected number in state $j$ at time $t$ after the start, the number of individuals under observation at time $t$ (including those who have died, but not those lost to follow-up) is multiplied by the probability of transition between the initial state and state $j$ in a time interval $t$.

This approach only makes sense for processes where all individuals start at a common time. For an example of this approach, see Gentleman et al. (1994).

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

msm, summary.msm, prevalencemisc.msm for the equivalent for models with misclassification