The voiageR package provides an R interface to the
voiage Python library for Value of Information (VOI)
analysis. This vignette demonstrates how to use the package to perform
common VOI analyses.
To use voiageR, you first need to install the Python
voiage package:
Then you can install voiageR from GitHub:
The Expected Value of Perfect Information (EVPI) represents the maximum amount a decision-maker should be willing to pay to eliminate all uncertainty in a decision model.
library(voiageR)
# Create sample net benefit data
# 1000 PSA samples, 2 strategies
net_benefits <- matrix(rnorm(2000), nrow = 1000, ncol = 2)
# Calculate EVPI
evpi_value <- evpi(net_benefits)
print(evpi_value)You can also scale the EVPI to a population:
The Expected Value of Partial Perfect Information (EVPPI) quantifies the value of learning the true value of a specific subset of model parameters.
The Expected Value of Sample Information (EVSI) estimates the value of conducting a specific study to reduce uncertainty.
# Define a simple model function
model_func <- function(params) {
# Simple example - in practice, this would be a more complex economic model
nb_strategy1 <- params$param1
nb_strategy2 <- params$param2
return(cbind(nb_strategy1, nb_strategy2))
}
# Create prior samples
prior_samples <- list(
param1 = rnorm(1000),
param2 = rnorm(1000)
)
# Define trial design
trial_design <- list(
treatment = list(name = "Treatment", sample_size = 50),
control = list(name = "Control", sample_size = 50)
)
# Calculate EVSI
evsi_value <- evsi(
model_func = model_func,
prior_samples = prior_samples,
trial_design = trial_design,
n_simulations = 100
)
print(evsi_value)If you have installed voiage in a specific Python
environment, you can specify which environment to use:
The voiageR package provides a seamless interface
between R and the powerful voiage Python library for Value
of Information analysis. This allows R users to leverage advanced VOI
methods while working in their preferred environment.