tpmatrix_id: Transition probability matrix IDs

View source: R/tpmatrix.R

tpmatrix_idR Documentation

Transition probability matrix IDs

Description

Creates ID variables for each row returned by tpmatrix(). This function is most conveniently used along with tpmatrix() to construct a tparams_transprobs() object.

Usage

tpmatrix_id(object, n_samples)

Arguments

object

An object of class expanded_hesim_data returned by expand.hesim_data(). This dataset must be expanded by treatment strategies, patients, and optionally time intervals.

n_samples

The number of parameters samples used for the probabilistic sensitivity analysis (PSA).

Value

Returns a tpmatrix_id object that inherits from data.table with the same columns in object repeated n_samples times. That is, to facilitate creation of a tparams_transprobs() object, there is one row for each parameter sample, treatment strategy, patient, and optionally time interval.

See Also

tpmatrix(), tparams_transprobs(), expand.hesim_data()

Examples

strategies <- data.frame(strategy_id = c(1, 2))
patients <- data.frame(patient_id = seq(1, 3), age = c(65, 50, 75),
                        gender = c("Female", "Female", "Male"))
hesim_dat <- hesim_data(strategies = strategies,
                        patients = patients)
input_data <- expand(hesim_dat, by = c("strategies", "patients"))    
tpmatrix_id(input_data, n_samples = 2)                   

hesim documentation built on Sept. 4, 2022, 1:06 a.m.