R/multi-state-helpers.R
add_counterfactual_transitions.Rd
If data only contains one row per transition that took place, this function adds additional rows for each transition that was possible at that time (for each subject in the data).
add_counterfactual_transitions(
data,
from_to_pairs = list(),
from_col = "from",
to_col = "to",
transition_col = "transition"
)
Data set that only contains rows for transitions that took place.
A list with one element for each possible initial state. The values of each list element indicate possible transitions from that state. Will be calculated from the data if unspecified.
Name of the column that stores initial state.
Name of the column that stores end state.
Name of the column that contains the transition identifier (factor variable).