Run the IVI-RA individual patient simulation model.
sim_iviRA(tx_seqs, input_data, pars, model_structures, max_months = NULL, tx_data = iviRA::treatments, hist = c("naive", "experienced"), output = c("data", "summary"), discount_qalys = 0.03, discount_cost = 0.03)
tx_seqs | Either a vector consisting of a single treatment sequence or a matrix of unique treatment sequences for each patient. |
---|---|
input_data | An object of class 'input_data' returned from get_input_data. |
pars | An object of class 'par_sample' returned from sample_pars. |
model_structures | An object of class "model_structures" returned from select_model_structures. |
max_months | Maximum number of months to run the model for. Default is NULL which implies that the model is simulated over each patient's lifetime. |
tx_data | Dataset of treatments with columns names equivalent to |
hist | Is the patient tDMARD naive or tDMARD experienced? |
output | Specifies the format of output returned from the simulation. Options are |
discount_qalys | Discount rate for QALYs. Only used when |
discount_cost | Discount rate for cost variables. Only used when |
When output = "data"
is selected, the simulation returns a data.table
with
simulated output for every model structure (model
), sampled parameter set
(sim
), patient (id
), treatment within a treatment sequence (tx
),
and time-period (month
) is returned. For more details on the output,
see the 'data' section below.
However, since all simulated output is returned, the size of the output can be very
large and can cause memory management issues. The output = "summary"
, which only
provides summaries of the simulation output, can be useful in the cases. In particular,
when output = "summary"
, the simulation returns three data.tables
:
A data.table
of mean model outcomes by model structure (model
)
and sampled parameter set (sim
). For details on the variables returned see the
'means' section below.
A data.table
of mean model outcomes by model structure (model
),
sampled parameter set (sim
), and month (month
). For details on the variables
returned see the 'time.means' section below.
Simulated model outcomes during model cycle 0 for each model structure
(model
), sampled parameter set (sim
), patient (id
), and
treatment within a treatment sequence (tx
). For details on the variables returned, see
the 'out0' section below.
Integer denoting a unique model structure corresponding to the row number in
model_structures
.
Simulation number denoting a randomly sampled parameter set from sample_pars.
ID number denoting a simulated patients (e.g., from sample_pop).
Month since a simulated patient began the first treatment in a treatment sequence.
Treatment used. Given J total therapies, the first J - 1 therapies match the indices from
tx_data
. The final tx
is always the non-biologic treatment (nbt_ind
).
Line of treatment in a treatment sequence. First treatment equal to 1, second treatment equal to 2, ...
Number of model cycles since a patient began taking a given treatment in a treatment sequence. tx_cycle
= 1
during the initial 6-month treatment period.
Equal to 1 if patient died during the model cycle and 0 otherwise.
Age of patient which increases with the model cycles.
Time to treatment discontinuation following the initial 6 month treatment period (i.e., after
tx_cycle=1
. Measured in terms of model cycles (e.g. ttd = 2 if treatment will discontinue in
1 year given 6-months cycles). ttd
is measured at the end of each cycle.
Patients switch treatments during the cycle in which ttd
becomes negative and HAQ
rebounds during the cycle.
Simulated ACR response during the initial 6-month period for a new treatment Constant within tx
.
Categories are 0 (ACR < 20), 1 (ACR 20-50), 2 (ACR 50-70), and 3 (ACR 70+).
Simulated EULAR response during the initial 6-month period for a new treatment Constant within tx
.
Categories are 0 (no EULAR response), 1 (moderate EULAR response), and 2 (good EULAR response).
Disease Activity Score 28 (DAS28).
Simplified Disease Activity Index (SDAI).
Clinical Disease Activity Index (CDAI).
HAQ score. Restricted to range between 0 and 3.
Time to serious infection. Like ttd
, measured in terms of model cycles. ttsi
is measured at the end of each
cycle.
Equal to 1 if treatment discontinuation was caused by a serious infection and 0 otherwise.
Length of a model cycle in years. Equal to 0.5 given 6-month cycles.
Treatment costs after discounts and rebates.
Hospitalization costs.
General management costs.
Costs due to serious infections.
Productivity loss (i.e., lost earnings).
Simulated utility score.
Quality-adjusted life-years (QALYs).
Integer denoting a unique model structure corresponding to the row number in
model_structures
.
Simulation number denoting a randomly sampled parameter set from sample_pars.
Life-years.
Discounted life-years.
Total life-years with a treatment administered by infusion.
Total life-years with a treatment administered by injection.
Total life-years with a treatment administered orally.
Change in HAQ from baseline (i.e., month 0) to final model cycle.
Number of serious infections.
Quality-adjusted life-years (QALYs).
Discounted QALYs.
Treatment costs.
Discounted treatment costs.
Hospital days.
Hospital costs.
Discounted hospital costs.
General management costs.
Discounted general management costs.
Costs due to serious infections.
Discounted costs due to serious infections.
Productivity loss (i.e., lost earnings).
Discounted productivity loss.
Discounted formal healthcare sector costs.
Discounted total (formal healthcare sector + productivity losses) costs.
Weighted mean of the number of years since approval of all treatments in a treatment sequence, with weights for a given treatment equal to the number of months a simulated patient used that treatment.
Annualized discounted QALYs. Assumes that QALYs accrue at a constant annual rate and are calculated over the maximum number of years that each simulated patient could survive during the model.
Annualized discounted formal healthcare sector costs. Calculated in the same
way as dqalys_ann
.
Annualized discounted productivity losses. Calculated in the same
way as dqalys_ann
.
Integer denoting a unique model structure corresponding to the row number in
model_structures
.
Simulation number denoting a randomly sampled parameter set from sample_pars.
Month since a simulated patient began the first treatment in a treatment sequence.
Number of simulated patients alive.
Quality-adjusted life-years.
HAQ score. Restricted to range between 0 and 3.
Treatment costs.
Hospital costs.
General management costs.
Costs due to serious infections.
Productivity loss (i.e., lost earnings).
Integer denoting a unique model structure corresponding to the row number in
model_structures
.
Simulation number denoting a randomly sampled parameter set from sample_pars.
ID number denoting a simulated patients (e.g., from sample_pop).
Treatment used. Given J total therapies, the first J - 1 therapies match the indices from
Simulated ACR response during the initial 6-month period for a new treatment Constant within tx
.
Categories are 0 (ACR < 20), 1 (ACR 20-50), 2 (ACR 50-70), and 3 (ACR 70+).
Simulated EULAR response during the initial 6-month period for a new treatment Constant within tx
.
Categories are 0 (no EULAR response), 1 (moderate EULAR response), and 2 (good EULAR response).
Time to treatment discontinuation. Measured in terms of model cycles (e.g. ttd = 2 if treatment will discontinue in
1 year given 6-months cycles). ttd
is measured at the end of each cycle. Patients switch treatments during the cycle in which ttd
becomes negative and HAQ rebounds during the cycle.
Time to serious infection. Like ttd
, measured in terms of model cycles. ttsi
is measured at the end of each
cycle.
pop <- sample_pop(n = 10, type = "homog") tx.seq <- c("adamtx", "cdmards") mod.structs <- select_model_structures(tx_ihaq = c("acr-haq", "acr-eular-haq"), tx_iswitch = c("acr-switch", "acr-eular-switch"), cdmards_haq_model = c("lcgm", "linear"), ttd_cause = c("all", "si"), ttd_dist = c("gengamma", "exponential"), utility_model = c("mixture", "wailoo")) input.dat <- get_input_data(pop = pop) parsamp <- sample_pars(n = 10, input_dat = input.dat) sim.out <- sim_iviRA(tx_seqs = tx.seq, input_data = input.dat, pars = parsamp, model_structures = mod.structs, output = "data") head(sim.out)#> model sim id month tx line tx_cycle death age ttd acr eular das28 sdai cdai #> 1: 1 1 1 6 4 1 1 0 55.0 0 0 NA NA NA NA #> 2: 1 1 1 12 1 2 1 0 55.5 0 0 NA NA NA NA #> 3: 1 1 1 18 21 3 1 0 56.0 NA 0 NA NA NA NA #> 4: 1 1 1 24 21 3 2 0 56.5 NA 0 NA NA NA NA #> 5: 1 1 1 30 21 3 3 0 57.0 NA 0 NA NA NA NA #> 6: 1 1 1 36 21 3 4 0 57.5 NA 0 NA NA NA NA #> haq ttsi si yrlen tx_cost hosp_days hosp_cost mgmt_cost si_cost #> 1: 1.500000 53.39888 0 0.5 26321.5389 0.6110033 635.4826 207.0549 0 #> 2: 1.500000 51.40948 0 0.5 110.3382 0.6110033 635.4826 207.0549 0 #> 3: 1.500000 NA 0 0.5 0.0000 0.6110033 635.4826 207.0549 0 #> 4: 1.507758 NA 0 0.5 0.0000 0.6110033 635.4826 207.0549 0 #> 5: 1.541003 NA 0 0.5 0.0000 0.6110033 635.4826 207.0549 0 #> 6: 1.553528 NA 0 0.5 0.0000 0.6110033 635.4826 207.0549 0 #> prod_loss utility qalys #> 1: 3550.941 0.6203959 0.3101979 #> 2: 3550.941 1.0000000 0.5000000 #> 3: 3550.941 0.7079691 0.3539845 #> 4: 3569.306 0.7208181 0.3604091 #> 5: 3648.006 0.6509538 0.3254769 #> 6: 3677.657 0.6343574 0.3171787