| Title: | CE Model |
|---|---|
| Description: | This is the Multiple Sclerosis MS Multiple Technology Appraisal MTA ID6369 Descrete Event Simulation DES Model. |
| Authors: | Ayman Sadek |
| Maintainer: | Ayman Sadek <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 1.0.0 |
| Built: | 2026-10-24 15:40:55 UTC |
| Source: | https://github.com/daysNmake/msdes |
A matrix of annual Disease Modifying Therapy DMT costs by year
df_c_txdf_c_tx
A matrix with 3 rows and 17 columns.
Each column contains the costs by treatment:
Annual DMT costs during 1st year of treatment
Annual DMT costs during 2nd year of treatment
British National Formulary
A matrix of annual treatment administration costs by year
df_c_tx_admindf_c_tx_admin
A matrix with 3 rows and 17 columns.
Each column contains the costs by treatment:
Annual treatment administration costs during 1st year of treatment
Annual treatment administration costs during 2nd year of treatment
UoB_TAG analysis (refer to report)
A matrix of annual treatment scheduled load factors years 1-5
df_c_tx_loaddf_c_tx_load
A matrix with 5 rows and 8 columns.
Each column contains the percentage of patients treated/re-treated by by DMT,
with the 5 rows repenting the load factors during the first years.
UoB_TAG analysis (refer to report)
A matrix of annual treatment monitoring costs by year
df_c_tx_monitordf_c_tx_monitor
A matrix with 3 rows and 17 columns.
Each column contains the costs by treatment:
Annual treatment monitoring costs during 1st year of treatment
Annual treatment monitoring costs during 2nd year of treatment
UoB_TAG analysis (refer to report)
draw_tte_new_warden() adds additional capability for the modelling of the UK life tables
draw_tte_new_warden( n_chosen, dist, coef1 = NULL, coef2 = NULL, coef3 = NULL, hr = 1, time = NULL, ..., beta_tx = 1, seed = NULL )draw_tte_new_warden( n_chosen, dist, coef1 = NULL, coef2 = NULL, coef3 = NULL, hr = 1, time = NULL, ..., beta_tx = 1, seed = NULL )
time |
should be the start times of the intervals (last is assumed to go to infinity) |
dcoef1 |
should be a vector of log-rates over time intervals |
Adaptation of WARDEN::draw_tte() to include piece wise exponential distributions Utilizing hesim::rpwexp()
gen_common_all_inputs() Global input parameters for the model are common to all patients and treatments.
gen_common_all_inputs()gen_common_all_inputs()
drc |
discount rate for costs |
drq |
discount rate for qalys |
reference |
The treatment arm specified as the reference for the comparison |
Input parameters here that do not change as we loop through treatments for a patient. The input parameters are called from 'gen_inputs()' function or the main analysis script. They are called in with 'WARDEN::add_item()' functions, these are piped with %>% operator. Probabilistic input parameters are specified with 'WARDEN::pick_val_v()' function creating a list of deterministic and probabilistic values
gen_init_events() WARDEN implementation of initial events
gen_init_events(RRMS_events)gen_init_events(RRMS_events)
reaction events run on treatment codes
gen_inputs() generates model inputs from saved data and returns a list with the data required for the model to run.
gen_inputs( drc = drc, drq = drq, time_horizon = time_horizon, p_eid = p_eid, jcvtest_cost = jcvtest_cost )gen_inputs( drc = drc, drq = drq, time_horizon = time_horizon, p_eid = p_eid, jcvtest_cost = jcvtest_cost )
drc |
discount rate for costs |
drq |
discount rate for qalys |
time_horizon |
the duration of the patients' life in the model |
p_eid |
proportion pf patients treated with Natalizumab Extended Interval Dosing |
jcvtest_cost |
JCV test cost assumption |
Stored within the function are all the default values of the inputs, some parameters are modifiable by user here as described below.
The generated inputs will be called and processed by gen_common_all_inputs() to specify common and gen_common_all_inputs() unique patient inputs,
by gen_init_events() to set initial and gen_react_events() reaction events. Parameters called by the model are specified here, they can be modified or new ones can be added.
a list of inputs
gen_react_events() WARDEN implementation of reaction events
gen_react_events(RRMS_events)gen_react_events(RRMS_events)
reaction events run on treatment codes
gen_unique_pt_inputs() Individual patient parameters of the model as they are unique patients and history including treatments
gen_unique_pt_inputs()gen_unique_pt_inputs()
sex |
individual patient sex |
n_relapse |
number of relapses counter |
n_edssinc_evts |
number of edss increases counter |
These are called for each new patient so sampled from distribution specified for heterogeneous characteristics and may depend on treatment Note that the current treatment is later initialised to trt
A matrix of patient counts stratified by EDSS score.
m_n_patients_edssm_n_patients_edss
A matrix with 2 rows and 10 columns.
Each column contains the number of patients at that EDSS score:
distribution of patients
distribution of patients
AFFIRM baseline
A matrix of patient counts stratified by treatment
m_proportion_ontrtlinem_proportion_ontrtline
A matrix with 4 rows and 8 columns.
Each column contains the number of patients on treatment at line of treatment :
distribution of patients on 2nd line treatment
distribution of patients on 2nd line treatment
distribution of patients on 3rd line treatment
distribution of patients on 3rd line treatment
MS Registry analysis
Natural history treatment dependent variance covariance.
A matrix with 3 rows and 3 columns
#'
intercept VCV
EDSS VCV
on treatment with Natalizumab VCV
MS Registry analysis
Natural history variance covariance.
A matrix with 2 rows and 2 columns
#'
intercept VCV
EDSS VCV
MS Registry analysis
rrmsdesmodel()RRMS DES model run written as a function to be called from Shiny APP
rrmsdesmodel(n_patients = n_patients, n_samples = n_samples)rrmsdesmodel(n_patients = n_patients, n_samples = n_samples)
For quick deployment, also used in ShinyApp.
rrmsdessetup()RRMS DES model inputs written as a function to be called from Shiny APP
rrmsdessetup( drc = drc, drq = drq, time_horizon = time_horizon, p_eid = p_eid, jcvtest_cost = jcvtest_cost )rrmsdessetup( drc = drc, drq = drq, time_horizon = time_horizon, p_eid = p_eid, jcvtest_cost = jcvtest_cost )
For quick deployment, also used in ShinyApp.
run_sim_new() modified run_sim() function
run_sim_new( arm_list = c("int", "noint"), sensitivity_inputs = NULL, common_all_inputs = NULL, common_pt_inputs = NULL, unique_pt_inputs = NULL, init_event_list = NULL, evt_react_list = evt_react_list, util_ongoing_list = NULL, util_instant_list = NULL, util_cycle_list = NULL, cost_ongoing_list = NULL, cost_instant_list = NULL, cost_cycle_list = NULL, other_ongoing_list = NULL, other_instant_list = NULL, npats = 500, n_sim = 1, psa_bool = NULL, sensitivity_bool = FALSE, sensitivity_names = NULL, n_sensitivity = 1, input_out = character(), ipd = 1, constrained = FALSE, timed_freq = NULL, debug = FALSE, accum_backwards = FALSE, continue_on_error = FALSE, seed = NULL, save_input_matrix = FALSE )run_sim_new( arm_list = c("int", "noint"), sensitivity_inputs = NULL, common_all_inputs = NULL, common_pt_inputs = NULL, unique_pt_inputs = NULL, init_event_list = NULL, evt_react_list = evt_react_list, util_ongoing_list = NULL, util_instant_list = NULL, util_cycle_list = NULL, cost_ongoing_list = NULL, cost_instant_list = NULL, cost_cycle_list = NULL, other_ongoing_list = NULL, other_instant_list = NULL, npats = 500, n_sim = 1, psa_bool = NULL, sensitivity_bool = FALSE, sensitivity_names = NULL, n_sensitivity = 1, input_out = character(), ipd = 1, constrained = FALSE, timed_freq = NULL, debug = FALSE, accum_backwards = FALSE, continue_on_error = FALSE, seed = NULL, save_input_matrix = FALSE )
This runs the model to allow for extra functionality for VOI analysis Appends input_matrix to results, this contains the paramters sampled per simulation
summarise_ce_results() Function to tabulate the PSA results at willingness to pay (WTP) thresholds
summarise_ce_results( wtp1 = wtp1, wtp2 = wtp2, total_qalys, total_costs, reference = "Natalizumab-IV" )summarise_ce_results( wtp1 = wtp1, wtp2 = wtp2, total_qalys, total_costs, reference = "Natalizumab-IV" )
wtp1 |
set the willingness to pay threshold, NICE default is £25,000 |
wtp2 |
set the willingness to pay threshold, NICE default is £35,000 |
total_qalys |
input from the model results: the average total quality adjusted life years per treatment arm |
total_costs |
input from the model results: the average total costs per treatment arm |
reference |
The treatment arm specified as the reference for the comparison |
Returns the incremental cost and qalys calculates the expected incremental cost effectiveness ratio calculates the expected incremental net benefit ratio returns the probability of treatment arms being cost effective
summarise_samples() Function to summarise PSA samples
summarise_samples(x, n_digits = 2)summarise_samples(x, n_digits = 2)
x |
data to be supplied |
returns the mean and 95% Credible Intervals
A matrix of excess all cause mortality for MS patients by severity
v_smr_severity_hardingv_smr_severity_harding
A matrix with 3 rows and 10 columns.
Each column contains the data by EDSS severity state:
average standard mortality ratio by severity state
standard deviationby severity state
log standard deviation by severity state
edss<4 (Jick et al), edss>=4 (Harding et al)
Natural history treatment dependent coefficients.
A named vector with 3 elements containing the formula coefficients: #'
intercept coefficient
EDSS coefficient
on treatment with Natalizumab coefficient
MS Registry analysis
Natural history coefficients.
A named vector with 2 elements containing the formula coefficients: #'
intercept coefficient
EDSS coefficient
MS Registry analysis