Beyond the States: Developing a Discrete Event Simulation Model Using R

Scritto il 28/11/2025
da Ziyi Lin

Pharmacoeconomics. 2025 Nov 28. doi: 10.1007/s40273-025-01560-6. Online ahead of print.

ABSTRACT

This illustration uses the Scottish Cardiovascular Disease (CVD) Policy Model as a case study to provide a comprehensive, step-by-step guide to building a discrete event simulation (DES) model in R. It is specifically designed for practitioners who are familiar with constructing Markov models in R and wish to transition their theoretical knowledge of DES into practical implementation. The Scottish CVD Policy Model was originally developed as an Excel-based Markov model with a sophisticated structure: a primary Markov model for first events and nested sub-Markov models for subsequent events. Later replicated in R by Xin, Yiqiao et al., the model's source code was made publicly available on GitHub, underscoring its potential as a teaching tool. The intricate structure of this model presents several challenges in health economic modeling, making it an ideal candidate for demonstrating how DES techniques can address such complexities effectively. In this illustration, we deliberately avoid using R packages developed specifically for DES to enhance transparency. Instead, we rely on base R functions, and the tidyverse package for tidy data wrangling. This approach ensures that every step of the DES implementation is clear and reproducible. In addition to covering fundamental topics such as how to simulate a time to event according to an assumed distribution, and continuous discounting, the illustration also provides solutions to more advanced modeling challenges, such as handling piecewise-modeled cost and utility. By discussing both general principles and complex scenarios, this paper equips readers with the practical tools needed to transition from Markov to DES frameworks, enhancing the accuracy and flexibility of health economic evaluations.

PMID:41313401 | DOI:10.1007/s40273-025-01560-6