Skip to contents

Transition probability matrix from an msmbayes model

Usage

pmatrix(draws, t = 1, new_data = NULL, X = NULL, drop = TRUE)

Arguments

draws

Object returned by msmbayes.

t

prediction time or vector of prediction times

new_data

Data frame with covariate values to predict for

X

Lower-level alternative to specifying new_data, for developer use only. X is a numeric matrix formed from column-binding the covariate design matrices for each transition in turn.

drop

Only used if there are no covariates supplied in new_data. Then if drop=TRUE this returns a nstates x nstates matrix, or if drop=FALSE this returns a 3D array with first dimension ncovs=1.

Value

Array or matrix of rvar objects giving the transition probability matrix at each requested prediction time and covariate value. See qdf for notes on the rvar format.

See also

pmatrixdf returns the same information in a tidy data frame format.