tpmatrix_id function

Transition probability matrix IDs

Transition probability matrix IDs

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

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).

Returns

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.

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)

See Also

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