find_nmb_allparams: Function to get NMB for a set of parameter This is the inner...

View source: R/evpi_estimators.R

find_nmb_allparamsR Documentation

Function to get NMB for a set of parameter This is the inner loop of the two stage Monte Carlo process

Description

Function to get NMB for a set of parameter This is the inner loop of the two stage Monte Carlo process

Usage

find_nmb_allparams(
  param_file,
  colnames_paramdistr,
  list_markov,
  threshold,
  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

comparator

optional parameter if need ICER as the output

Details

For the given set of parameter find the nmb from the packDAMipd function calculate_icer_nmb

Value

icer_nmb ICER and NMB using all sampled parameters

Examples

param_file <- system.file("extdata", "table_param.csv",
package = "packEVPI")
threshold <- 2000
colnames_paramdistr  <- c("Param1_name", "Param1_value", "Param2_name",
"Param2_value")
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))
nmbs <- find_nmb_allparams(param_file, colnames_paramdistr,
list_markov, threshold)

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