soprobMarkovOrdm
soprobMarkovOrdm.RdState Occupancy Probabilities for First-Order Markov Ordinal Model from a Model Fit
Usage
soprobMarkovOrdm(
object,
data,
times,
ylevels,
absorb = NULL,
tvarname = "time",
pvarname = "yprev",
gap = NULL
)Arguments
- object
a fit object created by
blrm,lrm,orm,VGAM::vglm(), orVGAM::vgam()- data
a single observation list or data frame with covariate settings, including the initial state for Y
- times
vector of measurement times
- ylevels
a vector of ordered levels of the outcome variable (numeric or character)
- absorb
vector of absorbing states, a subset of
ylevels. The default is no absorbing states. (numeric, character, factor)- tvarname
name of time variable, defaulting to
time- pvarname
name of previous state variable, defaulting to
yprev- gap
name of time gap variable, defaults assuming that gap time is not in the model
Value
if object was not a Bayesian model, a matrix with rows corresponding to times and columns corresponding to states, with values equal to exact state occupancy probabilities. If object was created by blrm, the result is a 3-dimensional array with the posterior draws as the first dimension.
Details
Computes state occupancy probabilities for a single setting of baseline covariates. If the model fit was from rms::blrm(), these probabilities are from all the posterior draws of the basic model parameters. Otherwise they are maximum likelihood point estimates.