Skip to contents

Generates predicted transition probabilities from an estimated beta and a specified set of subject covariate data using one of the following covariate averaging methods: mean - averages over all observations in covdata_byid, resulting in a single value for each covariate variable as the model input meanbyt - averages over all observations in covdata_byid per each timepoint t, resulting in a set of values (one for each timepoint t) for each covariate variable as the model input sampleavg - computes the model predictions for each separate observation in covdata, and then averages over all predictions for each timepoint t single - treats the covdata as representing a single subject or as a set of fixed intput values. No averaging applied.

Usage

trans.prob(
  modelobj,
  betavec_byblock = NULL,
  covdata_byid = NULL,
  extendtime = FALSE,
  method = NULL,
  groupvar = NULL
)

Arguments

modelobj

A pandista model object

betavec_byblock

A list of beta coefficient vectors, one for each block. If NULL, will use the estimated coefficients contained in modelobj

covdata_byid

A list of dataframes; each dataframe is the covariate data for one subject. If NULL, will use the covariate data as contained in modelobj

extendtime

Logical; If TRUE, extend each subject's covariate data to t.final before any averaging occurs. Extension is done by carrying forward the last observation for each subject.

method

String; Method to use for averaging. One of 'mean' (default), 'meanbyt', 'sampleavg', or 'single'.

groupvar

String; Name of a categorical grouping variable. Results will be computed separatedly for each level of the variable, and returned as a list