estimate_evpi: Function to estimate the expected value of partial perfect...

View source: R/evpi_estimators.R

estimate_evpiR Documentation

Function to estimate the expected value of partial perfect information This is the outer loop of the two stage Monte Carlo process

Description

Function to estimate the expected value of partial perfect information This is the outer loop of the two stage Monte Carlo process

Usage

estimate_evpi(
  param_file,
  colnames_paramdistr,
  list_markov,
  threshold,
  iterations,
  comparator = NULL
)

Arguments

param_file

all parameters required to run the model,provided with name of parameter, distribution and parameters that define the probability distribution

colnames_paramdistr

column names where parameter distribution and values are defined

list_markov

list of markov models to estimate the NMB

threshold

threshold values of WTP

iterations

number of iterations needed

comparator

optional parameter if need ICER as the output

Value

result result after evpi calculation

Source

https://www.sciencedirect.com/science/article/pii/S1098301510605888

Examples

param_file <- system.file("extdata", "table_param.csv",
package = "packEVPI")
colnames_paramdistr  <- c("Param1_name", "Param1_value", "Param2_name",
"Param2_value")
threshold  <-  20000
iterations <- 1
well <- packDAMipd::health_state("well", cost = "cost_well_co", utility = 1)
disabled <- packDAMipd::health_state("disabled", cost = "cost_dis_co",
utility = "utility_dis_co")
dead <- packDAMipd::health_state("dead", cost = 0, utility = 0)
tmat <- rbind(c(1, 2, 3), c(NA, 4, 5), c(NA, NA, 6))
colnames(tmat) <- rownames(tmat) <- c("well", "disabled", "dead")
tm <- packDAMipd::populate_transition_matrix(3, tmat,
c("tp_well_well_co","tp_well_dis_co","tp_well_dead", "tp_dis_dis_co",
"tp_dis_dead", "tp_dead_dead"),colnames(tmat))
health_states <- packDAMipd::combine_state(well, disabled, dead)
this.strategy <- packDAMipd::strategy(tm, health_states, "control")
param_file <- system.file("extdata", "table_param.csv",
package = "packEVPI")
param_list <- packDAMipd::define_parameters(
tp_well_dis_co = packDAMipd::get_parameter_read("tp_well_dis_co",
param_file),
tp_well_dis_in =  packDAMipd::get_parameter_read("tp_well_dis_in",
param_file),
tp_well_dead =  packDAMipd::get_parameter_read("tp_well_dead", param_file),
tp_dis_dead =  packDAMipd::get_parameter_read("tp_dis_dead", param_file),
 tp_dead_dead =  1,
 cost_well_co =  packDAMipd::get_parameter_read("cost_well_co", param_file),
 cost_well_in =  packDAMipd::get_parameter_read("cost_well_in", param_file),
 cost_dis_co =  packDAMipd::get_parameter_read("cost_dis_co", param_file),
 cost_dis_in =  packDAMipd::get_parameter_read("cost_dis_in", param_file),
 utility_dis_co =  packDAMipd::get_parameter_read("utility_dis_co",
 param_file),
 utility_dis_in =  packDAMipd::get_parameter_read("utility_dis_in",
 param_file),
 tp_well_well_co = "1-(tp_well_dis_co + tp_well_dead)",
 tp_well_well_in = "1-(tp_well_dis_in + tp_well_dead)",
 tp_dis_dis_co = "1-( tp_dis_dead)",
 tp_dis_dis_in = "1-( tp_dis_dead)")
 this_markov <- packDAMipd::markov_model(this.strategy, 24, c(1000, 0, 0),
 discount = c(0, 0),method = "half cycle correction", param_list)
 well <- packDAMipd::health_state("well", cost = "cost_well_in", utility = 1)
 disabled <- packDAMipd::health_state("disabled", cost = "cost_dis_in",
 utility = "utility_dis_in")
 dead <- packDAMipd::health_state("dead", cost = 0, utility = 0)
 tmat <- rbind(c(1, 2, 3), c(NA, 4, 5), c(NA, NA, 6))
 colnames(tmat) <- rownames(tmat) <- c("well", "disabled", "dead")
 tm <- packDAMipd::populate_transition_matrix(3, tmat, c("tp_well_well_in",
 "tp_well_dis_in", "tp_well_dead", "tp_dis_dis_in","tp_dis_dead",
 "tp_dead_dead"), colnames(tmat))
 health_states <- packDAMipd::combine_state(well, disabled, dead)
 this.strategy <- packDAMipd::strategy(tm, health_states, "intervention")
 sec_markov <- packDAMipd::markov_model(this.strategy, 24, c(1000, 0, 0),
 discount = c(0, 0), method = "half cycle correction", param_list)
 list_markov <- packDAMipd::combine_markov(list(this_markov, sec_markov))
estimate_evpi(param_file,colnames_paramdistr,list_markov, threshold,
iterations)

sheejamk/packEVPI documentation built on April 7, 2023, 8:48 a.m.