Simulation and Estimation of Continuous-Time Multi-State Markov Models for Panel Data
Overview
A higher-level interface to continuous-time Markov multi-state models for panel (interval-censored) data. Seven canonical clinical process structures are supplied with structurally valid generator matrices, so that transition matrices and starting values need not be constructed by hand. Panel data can be simulated from exact trajectories under regular or irregular observation schedules, with optional exactly observed absorption times and optional Weibull holding times for assessing the Markov assumption. A single fitting call validates the input against the assumed structure and returns the estimated generator with confidence intervals, mean sojourn times, transition probability matrices and observed transition counts, together with the optimiser's convergence code. A Monte Carlo driver reports Monte Carlo standard errors alongside bias, root mean squared error and interval coverage. Likelihood evaluation is delegated to 'msm' (Jackson, 2011, doi:10.18637/jss.v038.i08); the panel-data likelihood is that of Kalbfleisch and Lawless (1985) doi:10.1080/01621459.1985.10478195.
Initial release of the reorganised package.
- Trajectories are generated exactly and the panel record is formed by evaluating the trajectory at the observation times, keeping trajectory generation and panel construction separate.
sim_mspdata()supports irregular, subject-specific visit schedules, random missed visits, exactly observed absorption times, and Weibull (semi-Markov) holding times for assessing the Markov assumption.fit_msm()replacesfit.msm(), whose name collided with S3 dispatch on objects of classmsm.fit.msm()andsim.mspdata()remain as deprecated aliases.fit_msm()validates state coding, duplicate visit times and observed transitions against the assumed structure before calling the optimiser, supportsdeathexactfor exactly observed absorption, and reports the optimiser's convergence code.
Show all changes in 0.0.1Hide the rest of the changes in 0.0.1
ms_montecarlo()reports Monte Carlo standard errors alongside bias, RMSE and coverage, and counts non-convergence from the optimiser code rather than from the absence of an error.fit_msm()recovers from the numerical overflow thatmsmcan hit in large samples by refitting with a rescaled objective, and records this in therescaledelement. The retry runs only after an unscaled attempt has failed, so ordinary fits are unchanged.- Licence changed to GPL-3 for compatibility with
msm.
From NEWS.md in the release
Install
Health
- OK13 OKNow
- OK7 OK2026-09-04
Documentation
- Help pages
- 8
- Examples that run
- 88%7 run in a plain check · 1 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 100%
- Documented parameters
- 96%
- Return-value docs
- 100%
- Help pages citing references
- 13%
Downloads
Repository
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/infinitebstats/modmstates on 2026-10-22.
Dependencies
Installing modMStates adds 14 packages (10 with compiled code, 6.2 MB of source tarballs). Heaviest: mvtnorm 1.0 MB, vctrs 1.0 MB, msm 972 KB.
Code & Tests
People & History
- 0.0.1Latest2026-09-03 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-09-03
- Total releases
- 1 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Download size
- 21 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("modMStates")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.