  Health economic models simulate the costs and effects of health technologies
for use in health technology assessment (HTA) to inform efficient use of scarce
resources. Models have historically been developed using spreadsheet software
(e.g., Microsoft Excel) and while use of R is growing, general purpose modeling
software is still limited. hesim is an R package that helps fill this gap by
facilitating parameterization, simulation, and analysis of economic models in
an integrated manner. Supported model types include cohort discrete time state
transition models (cDTSTMs), individual continuous time state transition models
(iCTSTMs), and partitioned survival models (PSMs), encompassing Markov
(time-homogeneous and time-inhomogeneous) and semi-Markov processes. A modular
design based on R6 and S3 classes allows users to combine separate submodels
for disease progression, costs, and utility in a flexible way. Probabilistic
sensitivity analysis (PSA) is used to propagate uncertainty in model parameters
to model outputs. Simulation code is written in C++ so complex simulations such
as those combining PSA and individual simulation can be run much more quickly
than previously possible. Decision analysis within a cost-effectiveness
framework is performed using simulated costs and quality-adjusted life years
(QALYs) from a PSA.
