knitr::opts_chunk$set(eval = FALSE)
This is a guide to the code and software resources for the book Value of Information for Health Economic Evaluations (eds. Heath, Kunst, Jackson), (Chapman and Hall/CRC, 2024).
Before running any of this code, you should install the voi
package, which is 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.
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.
04_analysis/03_Expected_Value_of_Perfect_Information.R
(link to GitHub source)
04_analysis/04_Expected_Value_of_Partial_Perfect_Information.R
(link to GitHub source)
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")
04_analysis/05_Expected_Value_of_Sample_Information_MM.R
(link to GitHub source)
04_analysis/05_Expected_Value_of_Sample_Information_RB.R
(link to GitHub source)
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.