Value of Information for Health Economic Evaluations: book code resources
2024-09-16
Source:vignettes/book.Rmd
book.Rmd
This is a guide to the code and software resources for the book Value of Information for Health Economic Evaluations (eds. Heath, Jackson, Kunst). The book is under development, and when published, these resources will be linked from here.
Before running any of this code, you should install the
voi
package, which when the book is published will be
available from CRAN.
install.packages("voi")
Then you can set the working directory as follows
setwd(system.file("Chemotherapy_Book",package="voi"))
then your working directory should contain subdirectories that
include 01_data_raw
, 02_data
, etc. You can
check this by running the command list.files()
in your R
console.
Alternatively, you can copy the contents of the
Chemotherapy_Book
directory to your preferred working
directory, and work there instead. If you work in RStudio then it is
recommended to use a “project”. You could create a project for this work
by going to
File
,New Project
,Version Control
,Git
,
then selecting https://github.com/convoigroup/Chemotherapy_Book
as the Repository URL
, and changing the project name and
save location according to your preference.
Chapter 3: Chemotherapy case study
The code to run the baseline cost-effectiveness analysis (Section
2.4) is in the 04_analysis/02_baseline_model_output.R
subdirectory (link
to GitHub source). This can be run all at once using
source("04_analysis/02_baseline_model_output.R")
Or alternatively, open this file in R, and examine and run each line of code by hand.
Chapter 4: Value of Perfect Information
EVPI analysis for the Chemotherapy model (Section 3.2)
04_analysis/03_Expected_Value_of_Perfect_Information.R
(link
to GitHub source)
EVPPI analysis for the Chemotherapy model (Section 3.4)
04_analysis/04_Expected_Value_of_Partial_Perfect_Information.R
(link
to GitHub source)
Nonparametric regression examples
Code to draw illustrations of GAM regression (Figure 3.3)
misc_dir <- setwd(system.file("book_misc",package="voi"))
Code to draw illustrations of Gaussian process regression (Figure 3.4)
file.path("misc_dir", "gp_graphs.R")
Code to calculate EVPPI using nonparametric regression (Section 3.3.5)
file.path("misc_dir", "evppi_reg.Rmd")
Chapter 5: Value of Sample Information
Moment matching methods
04_analysis/05_Expected_Value_of_Sample_Information_MM.R
(link
to GitHub source)
Regression-based methods
04_analysis/05_Expected_Value_of_Sample_Information_RB.R
(link
to GitHub source)
Presenting EVSI and ENBS Analyses
For base R functions to reproduce the plots in the book, see the source on GitHub
For functions to calculate and optimise ENBS, and
ggplot2
recipes to reproduce similar plots, see the voi package vignette.