Log in

From Spreadsheets to Script: Experiences From Converting a Scottish Cardiovascular Disease Policy Model into R

  • Practical Application
  • Published:
Applied Health Economics and Health Policy Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or Ebook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (United Kingdom)

Instant access to the full article PDF.

Fig. 1

Source Adapted from references [15] and [16]

Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Briggs A, Claxton K, Sculpher M. Decision modelling for health economic evaluation. Oxford: Oxford University Press; 2006.

    Google Scholar 

  2. Weinstein MC, O’Brien B, Hornberger J, et al. Principles of good practice for decision analytic modeling in health-care evaluation: report of the ISPOR task force on good research practices—modeling studies. Value Health. 2003;6(1):9–17.

    Article  Google Scholar 

  3. Siebert U. When should decision-analytic modeling be used in the economic evaluation of health care? Eur J Health Econ. 2003;4(3):143–50.

    Article  Google Scholar 

  4. Jalal H, Pechlivanoglou P, Krijkamp E, Alarid-Escudero F, Enns E, Hunink MGM. An overview of R in health decision sciences. Med Dec Making. 2017;37(7):735–46.

    Article  Google Scholar 

  5. Incerti D, Thom H, Baio G, Jansen JP. R you still using excel? The advantages of modern software tools for health technology assessment. Value Health. 2019;22(5):575–9.

    Article  Google Scholar 

  6. Filipović-Pierucci A, Zarca K, D-Z I. Markov models for health economic evaluations: the R Package heemod 2017. 2021. https://arxiv.org/abs/1702.03252. Accessed 7 Jun 2021.

  7. Baio G, Berardi A. Bayesian cost-effectiveness analysis with the R package BCEA. Berlin: Springer International Publishing; 2017.

    Book  Google Scholar 

  8. Incerti D, JP Jansen. hesim: Health Economic Simulation Modeling and Decision Analysis 2021. 2021. https://arxiv.org/abs/2102.09437. Accessed 7 Jun 2021.

  9. Baio G. survHE: survival analysis for health economic evaluation and cost-effectiveness modeling. J Stat Softw. 2020;1:14.

    Google Scholar 

  10. R for Health Technology Assessment. Publications. 2021. https://r-hta.org/publication/. Accessed 17 Jan 2021.

  11. Williams C, Lewsey JD, Briggs AH, Mackay DF. Cost-effectiveness analysis in R using a multi-state modeling survival analysis framework: a tutorial. Med Dec Making. 2017;37(4):340–52.

    Article  Google Scholar 

  12. R for HTA Consortium. R for HTA annual workshop. 2020. https://r-hta.org/project/workshop/. Access 17 Jan 2021.

  13. National Institute for Health and Care Excellence. Guide to the processes of technology appraisal 2018. 2021. https://www.nice.org.uk/Media/Default/About/what-we-do/NICE-guidance/NICE-technology-appraisals/technology-appraisal-processes-guide-apr-2018.pdf. Accessed 17 Jan 2021.

  14. Smith R, Schneider P. Making health economic models shiny: a tutorial. Wellcome Open Res. 2020;5:69.

    Article  Google Scholar 

  15. Lawson KD, Lewsey JD, Ford I, et al. A cardiovascular disease policy model: part 2—preparing for economic evaluation and to assess health inequalities. Open Heart. 2016;3(1):e000140.

    Article  CAS  Google Scholar 

  16. Lewsey JD, Lawson KD, Ford I, et al. A cardiovascular disease policy model that predicts life expectancy taking into account socioeconomic deprivation. Heart. 2015;101(3):201.

    Article  CAS  Google Scholar 

  17. Putter H, Fiocco M, Geskus RB. Tutorial in biostatistics: competing risks and multi-state models. Stat Med. 2007;26(11):2389–430.

    Article  CAS  Google Scholar 

  18. Healthcare Improvement Scotland. SIGN 149 • Risk estimation and the prevention of cardiovascular disease. A national clinical guideline 2017. 2021. https://www.sign.ac.uk/assets/sign149.pdf. Accessed 16 Feb 2021.

  19. Gray CM, Wyke S, Zhang R, et al. Public Health Research. Long-term weight loss following a randomised controlled trial of a weight management programme for men delivered through professional football clubs: the Football Fans in Training follow-up study Chapter 5 Economic evaluation: methods and results. Southampton (UK): NIHR Journals Library; 2018.

  20. Riveros BS, Torelli Reis WC, Lucchetta RC, et al. Brazilian analytical decision model for cardiovascular disease: an adaptation of the Scottish cardiovascular disease policy model. Value Health Regional Issues. 2018;17:210–6.

    Article  Google Scholar 

  21. Kohli-Lynch CN. Beyond ten-year risk: novel approaches to the primary prevention of cardiovascular disease 2019. 2021. http://theses.gla.ac.uk/74296/. Accessed 17 Jan 2021.

  22. **n Y, Gray E, Robles-Zurita JA, et al. The Scottish cardiovascular disease (CVD) policy model 2020. 2021. https://github.com/yiqiaoxin/CVDmodel. Accessed 17 Jan 2021.

  23. Abbott S. Speed up discrete markov model cost effectiveness simulations 2020. 2021. https://www.samabbott.co.uk/SpeedyMarkov/. Accessed 17 Jan 2021.

  24. Getting Started with Plotly in R 2021. 2021. https://plotly.com/r/getting-started/. Accessed 14 Feb 2021.

  25. Health Economics R Packages 2020. 2021. https://github.com/n8thangreen/health_economics_R_packages. Accessed 17 Jan 2021.

  26. Alarid-Escudero F, Krijkamp EM, Pechlivanoglou P, et al. A need for change! a coding framework for improving transparency in decision modeling. Pharmacoeconomics. 2019;37(11):1329–39.

    Article  Google Scholar 

  27. Radeva D, Hopkin G, Mossialos E, Borrill J, Osipenko L, Naci H. Assessment of technical errors and validation processes in economic models submitted by the company for NICE technology appraisals. Int J Technol Assess Health Care. 2020;2020:1–6.

    Google Scholar 

  28. R for HTA Consortium. R for Health Technology Assessment 2020. 2021. https://r-hta.org/. Accessed 17 Jan 2021.

Download references

Acknowledgements

The original development of the Scottish Cardiovascular Policy Model was funded by the Chief Scientist Office for Scotland CZH/4/557. Mr Jesus Rodriguez Perez from the School of Computing Science at the University of Glasgow provided us with training on the version control software. The work has been presented at the R for Health Technology Assessment (HTA) showcase event in October 2020 organised by the R for HTA consortium. The authors have no financial relationships to disclose. Dr. Yiqiao **n is an associate at Analysis Group, Ltd. Research for this article was undertaken when she was working at University of Glasgow. The views presented in this article are those of the authors only. We sincerely thank the peer reviewers for their insightful and valuable inputs for this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yiqiao **n.

Ethics declarations

Funding

None.

Conflicts of interest

No relevant conflicts to disclose.

Ethics approval

Not applicable.

Consent to participate

Not applicable.

Consent for publication

Not applicable.

Availability of data and material

Not applicable.

Code availability

Code for the CVD model described in this article is available at https://github.com/yiqiaoxin/CVDmodel.

Authors’ contributions

YX, RH, EG, JL and AB conceptualized this project. YX, EG, JR, HH, JL, AB, CK, RH, KL and DM contributed to the model conversion process and the verification process between the Excel and R models. YX, EG, JR and HH conducted the actual R coding. YX and EG prepared the original draft and all authors critically reviewed the manuscript and provided editing and proofing.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary file1 (DOCX 15 kb)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

**n, Y., Gray, E., Robles-Zurita, J.A. et al. From Spreadsheets to Script: Experiences From Converting a Scottish Cardiovascular Disease Policy Model into R. Appl Health Econ Health Policy 20, 149–158 (2022). https://doi.org/10.1007/s40258-021-00684-y

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s40258-021-00684-y

Navigation