Skip to contents

Summarising data

statetable.msm()
Table of transitions

Fitting models

msm()
Multi-state Markov and hidden Markov models in continuous time
crudeinits.msm()
Calculate crude initial values for transition intensities
hmmCat() hmmIdent() hmmUnif() hmmNorm() hmmLNorm() hmmExp() hmmGamma() hmmWeibull() hmmPois() hmmBinom() hmmBetaBinom() hmmNBinom() hmmBeta() hmmTNorm() hmmMETNorm() hmmMEUnif() hmmT()
Hidden Markov model constructors
hmmMV()
Multivariate hidden Markov models
msm2Surv()
Convert data for `msm' to data for `survival', `mstate' or `flexsurv' analysis

Output from fitted models

qmatrix.msm()
Transition intensity matrix
pmatrix.msm()
Transition probability matrix
pmatrix.piecewise.msm()
Transition probability matrix for processes with piecewise-constant intensities
sojourn.msm()
Mean sojourn times from a multi-state model
totlos.msm() envisits.msm()
Total length of stay, or expected number of visits
pnext.msm()
Probability of each state being next
ppass.msm()
Passage probabilities
efpt.msm()
Expected first passage time
qratio.msm()
Estimated ratio of transition intensities
hazard.msm()
Calculate tables of hazard ratios for covariates on transition intensities
coef(<msm>)
Extract model coefficients
boot.msm()
Bootstrap resampling for multi-state models
ematrix.msm()
Misclassification probability matrix
odds.msm()
Calculate tables of odds ratios for covariates on misclassification probabilities
viterbi.msm()
Calculate the probabilities of underlying states and the most likely path through them
phasemeans.msm()
Parameters of phase-type models in mixture form
plot(<msm>)
Plots of multi-state models
print(<msm>) printnew.msm()
Print a fitted msm model object
printold.msm()
Print a fitted msm model object
summary(<msm>)
Summarise a fitted multi-state model
msm.form.qoutput() msm.form.eoutput()
Extract msm model parameter estimates in compact format

Tidy model outputs

tidy(<msm>)
Tidy the parameter estimates from an msm model
tidy(<msm.est>)
Tidy the output of pmatrix.msm and similar functions
tidy(<msm.estbystate>)
Tidy the output of totlos.msm and similar functions
tidy(<msm.prevalence>)
Tidy the output of prevalence.msm

Model checking and comparison

prevalence.msm()
Tables of observed and expected prevalences
plot(<prevalence.msm>)
Plot of observed and expected prevalences
plot(<survfit.msm>)
Plot empirical and fitted survival curves
plotprog.msm()
Kaplan Meier estimates of incidence
logLik(<msm>)
Extract model log-likelihood
lrtest.msm()
Likelihood ratio test
pearson.msm()
Pearson-type goodness-of-fit test
draic.msm() drlcv.msm()
Criteria for comparing two multi-state models with nested state spaces
scoreresid.msm()
Score residuals
surface.msm() contour(<msm>) persp(<msm>) image(<msm>)
Explore the likelihood surface

Simulation of data

sim.msm()
Simulate one individual trajectory from a continuous-time Markov model
simmulti.msm()
Simulate multiple trajectories from a multi-state Markov model with arbitrary observation times
simfitted.msm()
Simulate from a Markov model fitted using msm

Probability distributions

dpexp() ppexp() qpexp() rpexp()
Exponential distribution with piecewise-constant rate
dtnorm() ptnorm() qtnorm() rtnorm()
Truncated Normal distribution
d2phase() p2phase() q2phase() r2phase() h2phase()
Coxian phase-type distribution with two phases
dmenorm() pmenorm() qmenorm() rmenorm() dmeunif() pmeunif() qmeunif() rmeunif()
Measurement error distributions
qgeneric()
Generic function to find quantiles of a distribution

Datasets

cav
Heart transplant monitoring data
psor
Psoriatic arthritis data
aneur
Aortic aneurysm progression data
bos bos3 bos4
Bronchiolitis obliterans syndrome after lung transplants
fev
FEV1 measurements from lung transplant recipients

Miscellaneous utilities

deltamethod()
The delta method
MatrixExp()
Matrix exponential
model.frame(<msm>) model.matrix(<msm>)
Extract original data from msm objects.
recreate.olddata()
Convert data stored in msm object to old format
transient.msm() absorbing.msm()
Transient and absorbing states
hmodel2list()
Convert a hmodel object to HMM constructor function calls

Package internals (advanced)

msm.object
Fitted msm model objects
cmodel.object
Developer documentation: censoring model object
qmodel.object
Developer documentation: transition model structure object
qcmodel.object
Developer documentation: model for covariates on transition intensities
emodel.object
Developer documentation: misclassification model structure object
ecmodel.object
Developer documentation: model for covariates on misclassification probabilities
hmodel.object
Developer documentation: hidden Markov model structure object
paramdata.object
Developer documentation: internal msm parameters object
updatepars.msm()
Update the maximum likelihood estimates in a fitted model object.

Package overview

msm-package
Multi-State Markov and Hidden Markov Models in Continuous Time