2 state Cost-Effectiveness Model v16:
R
Markov model to estimate the impact of serious handling errors on the cost-effectiveness of asthma inhalers
Copyright (C) 2017 Mundipharma International
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
For access to the GNU General Public License, see .
OVERVIEW
The analysis relies on the following folder structure containing the
following files:
> InhalerMundiRfiles/
> Inhaler.R #This is the main script to perform analysis with
> InhalerMundiRfiles/lib #Contains bespoke functions to perform analysis
> InhalerFunctions.R #Contains main functions used by Inhaler.R
> DSAgen.R #Contains routine for DSA
> PSAgen.R #Contains routine for PSA
> InhalerMundiRfiles/data #Contains all data used within the analysis
> parameters.csv #Contains all parameters, their ranges and
> distributions for sensitivity analysis
REPRODUCING THE ANALYSIS
Begin by extracting all files to you preferred working directory. The only
change necessary to the files should be to change the working directory:
26> wrkng.dir <- "/InhalerMundiRfiles"
Please note that the analysis relies on a number of external packages. These
can be found at the top of the 'Inhaler.R' file. The general method for
installing packages in R is:
> install.packages('packageName')
The 'Inhaler.R' file can be run as per any standard R file. The helper
functions stored in /lib will be sourced automatically (assuming the folder
structure described above is maintained). The file runs 3 distinct analyses:
1) The base-case deterministic
2) Deterministic sensitivity analysis
3) Probabilistic sensitivity analysis
MODIFYING THE ANALYSIS
In order to permanently change default values, modifications may be made to
the data contained in 'parameters.csv'. When 'Inhaler.R' is run, this will
source the new data and the analysis will reflect the new parameter values.
In order to make non-permanent changes to the analysis, new parameters may be
assigned as required within the R session itself. For example, the line:
R> eval(parse(text=eq))
loads the model parameters into the Global Environment. New values for
specific parameters may be then assigned in the usual way. To change the
discount rate for costs to 5%, for example:
R> DiscountRateCost <- 0.05
And then re-run the required analysis, being careful not to re-run 'eval(parse(text=eq))',
which would override the newly assigned parameter values.
NB: Note that after running PSA or DSA, the line 'eval(parse(text=eq))' will be
re-run in order to reset parameters to the original Base.Cases in the parameters.csv file.
OUTPUT OF THE ANALYSIS
The code will generate some plots in pdf and some tables in csvs. The code at the end of the main code
deals with this. If it is wanted to change features of the output, like choosing different colours, etc,
this will be the place to do that.