R Scripts for Optimizing Trastuzumab Duration: Cost-Effectiveness Analysis of Five Regimens for HER2-Positive Breast Cancer in Kenya
# CUA-Trastuzumab-Kenya
R Scripts for Optimizing Trastuzumab Duration: Cost-Effectiveness Analysis of Five Regimens for HER2-Positive Breast Cancer in Kenya
Data needed before running anything
------------------------------------
Create a data/ folder with:
- model_parameters.csv - built from the values in S4_Appendix (Supplementary Material). Needs columns: Parameter, distribution, parameters, mean, sd, Base, min, max.
- psa_batches/ - a subfolder, can be left empty. If you want to reproduce the exact PSA results without waiting hours for it to re-run, copy psa_params.rds and the batch_*.rds files from the Supplementary Material into data/psa_batches/ before running script 1. If the folder is empty, script 1 generates fresh draws itself (same seed, so results should match).
Scripts - run in this order
----------------------------
1. markov_model_psa.R
Base case Markov model, full PSA (6000 iterations), one-way sensitivity analysis. Slow - budget a few hours. Can be run on its own.
2. psa_cost_table.R
Item-level cost breakdown table, built from the PSA batch files script 1 produces. Can be run any time after script 1 has finished, fresh R session is fine.
3. markov_model_trastuzumab_cap.R
Scenario analysis 1 - re-runs the base case with the trastuzumab price cap applied.
4. trastuzumab_price_threshold_scenario.R
Scenario analysis 2 - price sweep. Must run straight after script 3, in the same R session (it uses markovmodel() and my_params_basecase still in memory).
5. budget_impact_analysis.R
5-year budget impact. Also must run in the same session as script 3, after script 4 (it uses output_basecase in memory).
Scripts 3, 4 and 5 need to be run one after another without restarting R in between.
Output
------
Excel tables go to output/tables/, plots go to output/graphs/. Both are created automatically.
R packages needed
------------------
dampack, dplyr, tidyr, future, future.apply, ggplot2, patchwork, scales, openxlsx, writexl