Skip to contents

Mean sojourn times from an msmbayes model

Usage

mean_sojourn(draws, new_data = NULL, by_phase = TRUE)

Arguments

draws

Object returned by msmbayes.

new_data

Data frame with covariate values to predict for

by_phase

For states with phase type distributions:

If TRUE then one mean sojourn time per phase is returned.

If FALSE, then one overall mean sojourn time for the state is returned. This is not generally equal to the sum of the phase-specific mean sojourn times, because an individual may transition out of the state before progressing to the next phase.

Value

A data frame containing samples from the posterior distribution. See qdf for notes on this format and how to summarise.