Setup and parameters

Author
Affiliation

Vagish Hemmige

Albert Einstein College of Medicine

The code in this script loads the R packages used throughout the analysis and defines every model parameter: its base-case value, the shape parameter used for its prior distribution in the probabilistic sensitivity analysis, the willingness-to-pay threshold, the random seed, and the number of simulations.

RcodeSource code

The full R script is available at:

The code sections below are imported directly from that script when this page is rendered.

Libraries

The analysis uses the following R packages for building and drawing the decision trees, tables and figures, and for the probabilistic sensitivity analysis.

Click to show/hide R Code
library(DiagrammeR)
library(DiagrammeRsvg)
library(glue)
library(tibble)
library(gt)
library(tidyverse)
library(ggtext)
library(xml2)
library(BCEA)
library(ellipse)
library(svglite) #ggsave() needs svglite to save .svg figures
library(webshot2) #gtsave() needs webshot2 and a Chrome or Chromium installation to save .png tables

The table below is generated from the library() calls above when the page is rendered.

R package Purpose Documentation
DiagrammeR Decision tree diagrams (Graphviz) DiagrammeR
DiagrammeRsvg Export tree diagrams to SVG DiagrammeRsvg
glue String interpolation glue
tibble Data frames tibble
gt Tables gt
tidyverse Data management and plotting tidyverse
ggtext Formatted plot titles ggtext
xml2 Annotate SVG figures xml2
BCEA Bayesian cost-effectiveness analysis of the PSA BCEA
ellipse 95% ellipse on the cost-effectiveness plane ellipse
svglite Save figures as SVG svglite
webshot2 Save tables as PNG (needs Chrome or Chromium) webshot2

Base-case parameter values

Each parameter’s base-case value is stored in the list expected_value. These values produce the base case results and are the centre of each prior distribution in the probabilistic sensitivity analysis.

Click to show/hide R Code
#Save simulation parameters

#Expected values
expected_value<-list()
expected_value$p_usage<-0.43
expected_value$p_donor_cryptococcus<-0.001
expected_value$p_transmission<-0.867
expected_value$p_spont_cryptococcus<-0.005 
expected_value$p_sensitivity<-0.901
expected_value$p_specificity<-0.98 
expected_value$p_cancelled<-0.8
expected_value$p_prophrate<-0.51 
expected_value$p_prophefficacy<-0.88
expected_value$number_donors<-702
expected_value$cost_test<-2
expected_value$cost_disease<-110945
expected_value$cost_fluconazole<-6660
expected_value$cost_cancellation<-0
expected_value$cost_nocryptococcus<--10
expected_value$cost_nonacceptance<-0
expected_value$q_nocryptococcus<-5.5
expected_value$q_noacceptance<-0
expected_value$q_loss_cryptococcus<-2.5

Shape parameters

The list shape_parameter sets how widely each parameter varies in the sensitivity analyses. Probabilities have Beta priors: the shape parameter is \(\alpha\), and \(\beta = \alpha(1 - \mu)/\mu\), so the prior mean equals the base-case value \(\mu\). Costs and QALYs have gamma priors: the shape parameter is \(k\), and the scale is \(\theta = \mu/k\). A shape of NA fixes the parameter at its base-case value.

Click to show/hide R Code
#Shape parameters
shape_parameter<-list()
shape_parameter$p_usage<-10
shape_parameter$p_donor_cryptococcus<-10
shape_parameter$p_transmission<-10
shape_parameter$p_spont_cryptococcus<-10 
shape_parameter$p_sensitivity<-10
shape_parameter$p_specificity<-10 
shape_parameter$p_cancelled<-10
shape_parameter$p_prophrate<-10 
shape_parameter$p_prophefficacy<-10
shape_parameter$cost_test<-4
shape_parameter$cost_disease<-4
shape_parameter$cost_fluconazole<-4
shape_parameter$cost_cancellation<-NA
shape_parameter$cost_nocryptococcus<-NA
shape_parameter$cost_nonacceptance<-NA
shape_parameter$q_nocryptococcus<-4
shape_parameter$q_noacceptance<-NA
shape_parameter$q_loss_cryptococcus<-4

Willingness to pay, seed and number of simulations

Click to show/hide R Code
# willingness-to-pay threshold
wtp <- 100000  

#Set seed for reproducibility
set.seed(42)

#Define number of simulations in PSA
nsim<-10000

Parameter summary

The table below is computed from the code above when the page is rendered. The 95% interval is the 2.5th to 97.5th percentile of each prior distribution. The evidence for each value is reviewed on the evidence base page.

Warning: There were 2 warnings in `dplyr::mutate()`.
The first warning was:
β„Ή In argument: `lb_95 = dplyr::case_when(...)`.
Caused by warning in `qbeta()`:
! NaNs produced
β„Ή Run `dplyr::last_dplyr_warnings()` to see the 1 remaining warning.
Parameter Base-case value Shape Distribution Lower 95% Upper 95%
p_usage 0.43 10 Beta 0.241 0.631
p_donor_cryptococcus 0.001 10 Beta 0.000480 0.00171
p_transmission 0.867 10 Beta 0.630 0.989
p_spont_cryptococcus 0.005 10 Beta 0.00240 0.00853
p_sensitivity 0.901 10 Beta 0.679 0.996
p_specificity 0.98 10 Beta 0.853 1.00
p_cancelled 0.8 10 Beta 0.549 0.962
p_prophrate 0.51 10 Beta 0.296 0.722
p_prophefficacy 0.88 10 Beta 0.648 0.992
number_donors 702 β€” Label β€” β€”
cost_test 2 4 Gamma 0.545 4.38
cost_disease 110,945 4 Gamma 30,200 243,000
cost_fluconazole 6,660 4 Gamma 1,810 14,600
cost_cancellation 0 β€” Fixed β€” β€”
cost_nocryptococcus βˆ’10 β€” Fixed β€” β€”
cost_nonacceptance 0 β€” Fixed β€” β€”
q_nocryptococcus 5.5 4 Gamma 1.50 12.1
q_noacceptance 0 β€” Fixed β€” β€”
q_loss_cryptococcus 2.5 4 Gamma 0.681 5.48

number_donors labels the tree diagram’s starting cohort and is not varied in the sensitivity analyses. The willingness-to-pay threshold used for net monetary benefit is $100,000 per QALY, and the probabilistic sensitivity analysis uses 10,000 draws.