simfitted.msm: Simulate from a Markov model fitted using msm

View source: R/simul.R

simfitted.msmR Documentation

Simulate from a Markov model fitted using msm

Description

Simulate a dataset from a Markov model fitted using msm, using the maximum likelihood estimates as parameters, and the same observation times as in the original data.

Usage

simfitted.msm(x, drop.absorb = TRUE, drop.pci.imp = TRUE)

Arguments

x

A fitted multi-state model object as returned by msm.

drop.absorb

Should repeated observations in an absorbing state be omitted. Use the default of TRUE to avoid warnings when using the simulated dataset for further msm fits. Or set to FALSE if exactly the same number of observations as the original data are needed.

drop.pci.imp

In time-inhomogeneous models fitted using the pci option to msm, censored observations are inserted into the data by msm at the times where the intensity changes, but dropped by default when simulating from the fitted model using this function. Set this argument to FALSE to keep these observations and the corresponding indicator variable.

Details

This function is a wrapper around simmulti.msm, and only simulates panel-observed data. To generate datasets with the exact times of transition, use the lower-level sim.msm.

Markov models with misclassified states fitted through the ematrix option to msm are supported, but not general hidden Markov models with hmodel. For misclassification models, this function includes misclassification in the simulated states.

This function is used for parametric bootstrapping to estimate the null distribution of the test statistic in pearson.msm.

Value

A dataset with variables as described in simmulti.msm.

Author(s)

C. H. Jackson chris.jackson@mrc-bsu.cam.ac.uk

See Also

simmulti.msm, sim.msm, pearson.msm, msm.


msm documentation built on Oct. 5, 2024, 1:07 a.m.