Related Experiment Video
Updated: Oct 16, 2025

An R-Based Landscape Validation of a Competing Risk Model
Published on: September 16, 2022
From Spreadsheets to Script: Experiences From Converting a Scottish Cardiovascular Disease Policy Model into R
Yiqiao Xin1, Ewan Gray2, Jose Antonio Robles-Zurita3
1Health Economics and Health Technology Assessment (HEHTA), Institute of Health and Wellbeing, University of Glasgow, Glasgow, UK. yiqiao.xin@analysisgroup.com.
Abstract:
Given the advantages in transparency, reproducibility, adaptability and computational efficiency in R, there is a growing interest in converting existing spreadsheet-based models into an R script for model re-use and upskilling training among health economic modellers. The objective of this exercise was to convert the Scottish Cardiovascular Disease (CVD) Policy Model from Excel to R and discuss the lessons learnt throughout this process. The CVD model is a competing risk state transition cohort model. Four health economists, with varied experience of R, attempted to replicate an identical model structure in R based on the model in Excel and reproduce the intermediate and final results. Replications varied in their use of specialist health economics packages in addition to standard data management packages. Two versions of the CVD model were created in R along with a Shiny app. Version 1 was developed without health economics specialist packages and produced identical results to the Excel version. Version 2 used the heemod package and did not achieve the same results, possibly due to the non-standard elements of the model and limited time to adapt the functions. The R model requires less than half the computational time than the Excel model. Conversion of the spreadsheet models to script models is feasible for health economists. A step-by-step guide for the conversion process is provided and modellers' experience is discussed. Coding without specialist packages allows full flexibility, while specialist packages may add convenience if the model structure is suitable. Whichever approach is taken, transparency and replicability remain the key criteria in model programming. Model conversions must maintain standards in these areas regardless of the choice of software.
Related Concept Videos
Statistical Methods for Analyzing Epidemiological Data
Introduction To Survival Analysis
The primary goal of survival analysis is to estimate survival time—the time...
Model Approaches for Pharmacokinetic Data: Physiological Models
Assumptions of Survival Analysis
Interpreting R Charts
An R chart plots the range of subsets of measurements collected from a process. Each point on the chart represents the range—defined as the difference between the maximum and minimum...
Introduction to R

