Simulate health state transitions in a cohort discrete time state transition model.
An R6::R6Class object.
paramsParameters for simulating health state transitions. Supports objects of class tparams_transprobs or params_mlogit.
input_dataAn object of class input_mats.
cycle_lengthThe length of a model cycle in terms of years.
The default is 1 meaning that model cycles are 1 year long.
start_stateprobsA non-negative vector with length equal to the number of
health states containing the probability that the cohort is in each health
state at the start of the simulation. For example,
if there were three states and the cohort began the simulation in state 1,
then start_stateprobs = c(1, 0, 0). Automatically normalized to sum to 1.
If NULL, then a vector with the first element equal to 1 and
all remaining elements equal to 0.
trans_matA transition matrix describing the states and transitions
in a discrete-time multi-state model. Only required if the model is
parameterized using multinomial logistic regression. The (i,j) element
represents a transition from state i to state j. Each possible transition
from row i should be based on a separate multinomial logistic regression
and ordered from 0 to K - 1 where K is the number of
possible transitions. Transitions that are not possible should be NA.
and the reference category for each row should be 0.
new()Create a new CohortDtstmTrans object.
CohortDtstmTrans$new( params, input_data = NULL, trans_mat = NULL, start_stateprobs = NULL, cycle_length = 1 )
paramsThe params field.
input_dataThe input_data field.
trans_matThe trans_mat field.
start_stateprobsThe start_stateprobs field.
cycle_lengthThe cycle_length field.
A new CohortDtstmTrans object.
sim_stateprobs()Simulate probability of being in each health state during each model cycle.
CohortDtstmTrans$sim_stateprobs(n_cycles)
n_cyclesThe number of model cycles to simulate the model for.
An object of class stateprobs.
clone()The objects of this class are cloneable with this method.
CohortDtstmTrans$clone(deep = FALSE)
deepWhether to make a deep clone.