Learn R Programming

hesim (version 0.2.3)

hesim_data: Data for health-economic simulation modeling

Description

A list of tables required for health-economic simulation modeling. Each table must either be a data.frame or data.table. All ID variables within each table must be numeric vectors of integers.

Usage

hesim_data(
  strategies,
  patients,
  lines = NULL,
  states = NULL,
  transitions = NULL,
  times = NULL
)

Arguments

strategies

A table of treatment strategies. Must contain the column strategy_id denoting a unique strategy. Other columns are variables describing the characteristics of a treatment strategy.

patients

A table of patient observations. Must contain the column patient_id denoting a unique patient. The number of rows should be equal to the number of patients in the model. Other columns are variables describing the characteristics of a patient.

lines

A table of treatment lines used for each treatment strategy. Must contain the columns strategy_id, denoting a treatment strategy, and line, denoting a treatment line. Other columns are variables describing the characteristics of a treatment line for a given treatment strategy. A column denoting the treatment used for a given strategy and line would often be specified. Not currently supported.

states

A table of health states. Must contain the column state_id, which denotes a unique health state. The number of rows should be equal to the number of health states in the model. Other columns can describe the characteristics of a health state.

transitions

A table of health state transitions. Must contain the column transition_id, which denotes a unique transition; from, which denotes the starting health state; and to which denotes the state that will be transitioned to.

times

A table of time intervals. Must contain the column time_start, which denotes the starting time of times intervals defined between time_start and time_stop. hesim_data() automatically creates the columns time_stop and time_id (a vector of integers sorted by time_start). Time intervals are closed on the left and open on the right and the final time interval is defined from time_start to infinity.

Value

Returns an object of class "hesim_data", which is a list of data tables for health economic simulation modeling.

See Also

expand.hesim_data

Examples

Run this code
# NOT RUN {
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"))
states <- data.frame(state_id =  seq(1, 3),
                        state_var = c(2, 1, 9))
times <- data.frame(time_id = c(1, 2, 3),
                    time_start = c(0, 4, 9),
                    time_stop = c(4, 9, Inf))
hesim_dat <- hesim_data(strategies = strategies,
                         patients = patients,
                         states = states,
                         times = times)
# }

Run the code above in your browser using DataLab