soprobMarkovOrdm: soprobMarkovOrdm

soprobMarkovOrdmR Documentation

soprobMarkovOrdm

Description

State 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(), or VGAM::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

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.

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.

Author(s)

Frank Harrell

See Also

https://hbiostat.org/R/Hmisc/markov/


Hmisc documentation built on Sept. 12, 2023, 5:06 p.m.