create_trans_dt: Create a data table of health state transitions

View source: R/hesim_data.R

create_trans_dtR Documentation

Create a data table of health state transitions

Description

Create a data table of health state transitions from a transition matrix describing the states and transitions in a multi-state model suitable for use with hesim_data.

Usage

create_trans_dt(trans_mat)

Arguments

trans_mat

A transition matrix in the format from the mstate package. See IndivCtstmTrans.

Value

Returns a data.table in tidy format with three columns:

transition_id

Health state transition ID.

from

The starting health state.

to

The health state that will be transitions to.

Examples

tmat <- rbind(c(NA, 1, 2),
              c(NA, NA, 3),
              c(NA, NA, NA))
create_trans_dt(tmat)

dincerti/cea documentation built on Feb. 16, 2024, 1:15 p.m.