The University of Sheffield
Browse

Individual level discrete event simulation taught on the MSc Health Economics and Decision Modelling (based on NICE DSU TSD15 model) in R

software
posted on 2025-05-02, 14:42 authored by Daniel PollardDaniel Pollard, Matthew StevensonMatthew Stevenson

This deposit is of an individual level economic model, taught on the MSc Health Economics and Decision Modelling in SIMUL8. This model is heavily based on the one described in NICE DSU TSD 15.1 This model is a rebuild of the final version of the model taught on the MSc by Matt Stevenson, in R code rather than suing SIMUL8 software.

The model simulates the occurrence of hip fractures, up to two vertebrate fractures and death using discrete event simulation.

The data folder contains:

Parameters.csv, which is all of the parameters that are used in the model. Different columns are different parameter values and different rows are different values that can be used when uncertainty is analysed in a probabilistic sensitivity analysis.

Global Options.csv, which is a file containing user defined values for changing options within the model.

These are constant across versions.

All versions build on each other. The R folder contains user defined code, which is called within each other or into the Run Analyses.R file which conducts the analysis.

In the final version (1.3) this contains the following files that have the following purpose:

Continuous discounting.R, this contains a function that takes the input of two times in years and the discount rate and calculates the amount of discounted life expectancy between the two times.

Standard discounting.R, this contains a function that takes the input of a given time and the discount rate and calculates how much you need to reduce the value of any cost or QALY. This should be used for one-off costs or QALY decrements.

Deaths.R, this contains the function that calculates costs and quality adjusted life years for a given patient and set of parameters upon the death event in the model

Hip Fracture.R, this contains the function that calculates whether the patient dies immediately and calculates costs and quality adjusted life years for a given patient and set of parameters upon the hip fracture event in the model

Vert Fracture.R, this contains the function that calculates costs and QALYs upon the incidence of a vert fracture (either 1st or 2nd vert fracture).

Single Model Run.R, this contains the function that conducts a run of the model on a single set of parameters. This includes sampling the time Hip fracture, 1st Vert fracture, 2nd Vert fracture and death from either a Weibull or normal distribution and a given estimate distribution parameters, the events are ordered from time 0 until death. Any events after death are set to be missing for each patient. The model loops over each patient and each event they experience to calculate the costs and QALYs accrued for that patient. Finally the model calculates average costs and QALYs across the whole population.

Run Model.R, this contains a function that calls in the function in Single Model Run.R, the model parameters and the Global options to conduct a probabilistic sensitivity analysis or a run on only the deterministic model parameters.


Version 1.0

Runs the model deterministically.

Version 1.1

Runs the model accounting for uncertainty in the model parameters using a probabilistic sensitivity analysis

Version 1.2

Same as version 3, but the the PSA now uses parallel processing so multiple models can be run on different parameter sets at once, making analyses faster to conduct.

Version 1.3

This release tidies up the model to have good practice for running simulations for a paper. There is a new function run model, that appropriately runs the model according to the user settings. Run Analyses.R script has been tidied up so that it runs a series of analyses and saves the results, so you can run all analyses for a report/paper just by loading the .Rproj file and then loading this script. Users will need to make a new folder to Results and add /Results into .gitignore file locally before running, as otherwise the model won't be able to save the results appropriately.


Change the maximum number of cores & PSA runs to 16 in the Global Options.csv file, so it doesn't take too long to run when demonstrating. If testing for yourself, uncomment line 49 in the Run Analysis.R file so that 1000 PSA runs will be conducted.


References

1) Davis, S., Stevenson, M., Tappenden, P., Wailoo, A.J. NICE DSU Technical Support Document 15: Cost-effectiveness modelling using patient-level simulation. 2014. Available from: https://www.sheffield.ac.uk/media/34206/download?attachment. Last Accessed 1st May 2025

History

Ethics

  • There is no personal data or any that requires ethical approval

Policy

  • The data complies with the institution and funders' policies on access and sharing

Sharing and access restrictions

  • The uploaded data can be shared openly

Data description

  • The file formats are open or commonly used

Methodology, headings and units

  • Headings and units are explained in the files

Responsibility

  • The depositor is responsible for the content and sharing of the attached files

Usage metrics

    School of Health and Related Research

    Licence

    Exports

    RefWorks
    BibTeX
    Ref. manager
    Endnote
    DataCite
    NLM
    DC