
Last chance! 50% off unlimited learning
Sale ends in
Create an object of class input_mats
, which contains inputs matrices
for simulating a statistical model. Consists of (i) input matrices, X
, and
(ii) metadata used to index each matrix in X
.
More details are provided under "Details" below.
input_mats(X, ...)
A list of input matrices for predicting the values of each parameter
in a statistical model. May also be a list of lists of input matrices when a
list of separate models is fit (e.g., with flexsurvreg_list()
).
Arguments to pass to id_attributes()
.
Each row of each matrix X
is an input vector, state_id
or a transition between health states (e.g., transition_id
).
In some cases, the health-related index
The rows of the matrices in X
must be sorted in a manner consistent with the ID variables as
described in id_attributes()
.
# NOT RUN {
strategies <- data.frame(strategy_id = c(1, 2))
patients <- data.frame(patient_id = seq(1, 3),
age = c(45, 47, 60),
female = c(1, 0, 0),
group = factor(c("Good", "Medium", "Poor")))
hesim_dat <- hesim_data(strategies = strategies,
patients = patients)
dat <- expand(hesim_dat, by = c("strategies", "patients"))
input_mats <- input_mats(X = list(mu = model.matrix(~ age, dat)),
strategy_id = dat$strategy_id,
n_strategies = length(unique(dat$strategy_id)),
patient_id = dat$patient_id,
n_patients = length(unique(dat$patient_id)))
print(input_mats)
# }
Run the code above in your browser using DataLab