Excel Front-End, R Back-End: A Gateway to Faster Individual Patient Simulations and Probabilistic Sensitivity Analyses in Cost-Effectiveness Models for HTA
Author(s)
Laura J. Clark, DPhil1, Alex Mclean, MSci2, Naomi van Hest, MSc2.
1Costello Medical, Manchester, United Kingdom, 2Costello Medical, Bristol, United Kingdom.
1Costello Medical, Manchester, United Kingdom, 2Costello Medical, Bristol, United Kingdom.
OBJECTIVES: Cost-effectiveness models (CEMs) are commonly developed in Microsoft Excel® for health technology assessments (HTA) due to familiarity, usability and perceived greater transparency. However, the computing speed of Excel is limited as it cannot perform element-wise operations on vectors or use multiple computing cores. Therefore, Excel can be slow for complex models, especially individual patient simulations (IPS) which track events for each patient over time, and probabilistic sensitivity analyses (PSA) which require thousands of iterations to parameterise model uncertainty. Here, we adapted an IPS Excel CEM, retaining the Excel interface while running the IPS and PSA in R.
METHODS: Using four surrogate endpoints, the CEM modelled eight clinical events across 1,000 cycles for 1,000 patients. The Excel CEM was adapted to run the IPS in R while retaining the Excel interface. Visual basic for applications (VBA) was used to export Excel inputs to R, where the IPS and PSA were run, and import results to Excel for interpretation. VBA code originally used for the CEM was translated to iterative (per patient) R code, before vectorising (all patients as one matrix). Analysis time was measured across three scenarios, each ran five times on the same Windows machine.
RESULTS: Across all IPS scenarios, vectorised R (mean [95% CI]: 35.1 s [29.2, 41.0]) was the fastest followed by iterative R (150.2 s [148.5, 151.9]) and VBA (166.2 s [164.9, 167.5]). Further results are anticipated for the PSA.
CONCLUSIONS: R demonstrated efficiencies over Excel, specifically when vectorised. Additional efficiencies would be expected when running PSAs with thousands more iterations, and further when utilising multiple cores to multi-thread the model. This shows R’s potential to improve CEM run-time while retaining a familiar Excel interface, which may support uptake of programming languages other than VBA for CEM development, and increase acceptance of these methods by HTA agencies.
METHODS: Using four surrogate endpoints, the CEM modelled eight clinical events across 1,000 cycles for 1,000 patients. The Excel CEM was adapted to run the IPS in R while retaining the Excel interface. Visual basic for applications (VBA) was used to export Excel inputs to R, where the IPS and PSA were run, and import results to Excel for interpretation. VBA code originally used for the CEM was translated to iterative (per patient) R code, before vectorising (all patients as one matrix). Analysis time was measured across three scenarios, each ran five times on the same Windows machine.
RESULTS: Across all IPS scenarios, vectorised R (mean [95% CI]: 35.1 s [29.2, 41.0]) was the fastest followed by iterative R (150.2 s [148.5, 151.9]) and VBA (166.2 s [164.9, 167.5]). Further results are anticipated for the PSA.
CONCLUSIONS: R demonstrated efficiencies over Excel, specifically when vectorised. Additional efficiencies would be expected when running PSAs with thousands more iterations, and further when utilising multiple cores to multi-thread the model. This shows R’s potential to improve CEM run-time while retaining a familiar Excel interface, which may support uptake of programming languages other than VBA for CEM development, and increase acceptance of these methods by HTA agencies.
Conference/Value in Health Info
2025-11, ISPOR Europe 2025, Glasgow, Scotland
Value in Health, Volume 28, Issue S2
Code
MSR101
Topic
Economic Evaluation, Methodological & Statistical Research
Disease
No Additional Disease & Conditions/Specialized Treatment Areas