| Title: | Economic Evaluation Methods for Cost-Benefit, Partial Budgeting, and Cost-Effectiveness Analyses |
|---|---|
| Description: | Provides functions for economic evaluation, including Cost-Benefit Analysis (CBA), Benefit-Cost Ratio (BCR), Net Present Value (NPV), Internal Rate of Return (IRR), Partial Budgeting, Budget Impact Analysis (BIA), Cost-Effectiveness Analysis (CEA), Decision Tree Analysis, Sensitivity Analysis, and Probabilistic Sensitivity Analysis. The package produces summaries, graphical displays, and reproducible workflows for applications in veterinary science, agriculture, public health, epidemiology, health economics, and related fields. |
| Authors: | Vinodhkumar Obli Rajendran [aut, cre], Keerthi Aaradhana [aut] |
| Maintainer: | Vinodhkumar Obli Rajendran <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-09-22 10:19:38 UTC |
| Source: | https://github.com/vinodhpmd/econevalr |
Convert an EconBCR object to a data frame
## S3 method for class 'EconBCR' as.data.frame(x, ...)## S3 method for class 'EconBCR' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame with one row containing the benefit, cost, benefit-cost ratio, and decision.
Converts an object of class "EconBIA" into a data frame
suitable for exporting or further analysis.
## S3 method for class 'EconBIA' as.data.frame(x, ...)## S3 method for class 'EconBIA' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing the annual budget impact results.
## Not run: df <- as.data.frame(bia) head(df) ## End(Not run)## Not run: df <- as.data.frame(bia) head(df) ## End(Not run)
Convert a Cost-Effectiveness Acceptability Curve Object to a Data Frame
## S3 method for class 'EconCEAC' as.data.frame(x, ...)## S3 method for class 'EconCEAC' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing the willingness-to-pay thresholds, probabilities of cost-effectiveness, and mean incremental net monetary benefit.
Converts an object of class "EconCEAF" into a data
frame suitable for exporting or further analysis.
## S3 method for class 'EconCEAF' as.data.frame(x, ...)## S3 method for class 'EconCEAF' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Willingness-to-pay threshold.
Optimal strategy at each WTP.
Probability that the optimal strategy is cost-effective.
Expected Net Monetary Benefit of the optimal strategy.
## Not run: df <- as.data.frame(ceaf) head(df) ## End(Not run)## Not run: df <- as.data.frame(ceaf) head(df) ## End(Not run)
Converts an object of class "EconEVPI" into a data
frame suitable for exporting or further analysis.
## S3 method for class 'EconEVPI' as.data.frame(x, ...)## S3 method for class 'EconEVPI' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Willingness-to-pay threshold.
Expected Value of Perfect Information.
Expected value under perfect information,
.
Expected value under current information,
.
## Not run: df <- as.data.frame(evpi) head(df) ## End(Not run)## Not run: df <- as.data.frame(evpi) head(df) ## End(Not run)
Convert an Expected Value of Partial Perfect Information Object to a Data Frame
## S3 method for class 'EconEVPPI' as.data.frame(x, ...)## S3 method for class 'EconEVPPI' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame.
Convert a Probabilistic Sensitivity Analysis Object to a Data Frame
## S3 method for class 'EconPSA' as.data.frame(x, ...)## S3 method for class 'EconPSA' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing every Monte Carlo simulation.
Convert a Tornado Diagram Object to a Data Frame
## S3 method for class 'EconTornado' as.data.frame(x, ...)## S3 method for class 'EconTornado' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame.
Converts an object of class "EconTree" into a data frame
suitable for exporting or further analysis.
## S3 method for class 'EconTree' as.data.frame(x, ...)## S3 method for class 'EconTree' as.data.frame(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
A data frame containing the terminal node results.
## Not run: df <- as.data.frame(tree) head(df) ## End(Not run)## Not run: df <- as.data.frame(tree) head(df) ## End(Not run)
Computes the Benefit-Cost Ratio (BCR) for an investment, intervention, or project.
benefit_cost_ratio(benefit, cost)benefit_cost_ratio(benefit, cost)
benefit |
Numeric. Total discounted benefits. |
cost |
Numeric. Total discounted costs. |
The Benefit-Cost Ratio is calculated as
An object of class "EconBCR".
benefit_cost_ratio( benefit = 150000, cost = 100000 )benefit_cost_ratio( benefit = 150000, cost = 100000 )
Performs a Budget Impact Analysis (BIA) by comparing the projected healthcare expenditure under current practice with a new intervention over multiple years.
budget_impact_analysis( population, uptake, current_cost, new_cost, years = length(uptake), discount = 0 )budget_impact_analysis( population, uptake, current_cost, new_cost, years = length(uptake), discount = 0 )
population |
Numeric scalar representing the eligible population. |
uptake |
Numeric vector representing the annual uptake proportions (0-1) of the new intervention. |
current_cost |
Numeric scalar giving the annual cost per patient under current practice. |
new_cost |
Numeric scalar giving the annual cost per patient under the new intervention. |
years |
Integer giving the number of years. |
discount |
Annual discount rate (default = 0). |
The function calculates, for each year:
Eligible population
Number treated
Current budget
New budget
Incremental budget impact
Discounted budget impact
Cumulative discounted impact
An object of class "EconBIA".
bia <- budget_impact_analysis( population = 10000, uptake = c(0.10,0.20,0.35,0.45,0.60), current_cost = 1200, new_cost = 1500, years = 5, discount = 0.03 ) print(bia) summary(bia) plot(bia) as.data.frame(bia)bia <- budget_impact_analysis( population = 10000, uptake = c(0.10,0.20,0.35,0.45,0.60), current_cost = 1200, new_cost = 1500, years = 5, discount = 0.03 ) print(bia) summary(bia) plot(bia) as.data.frame(bia)
Performs a cost-effectiveness analysis.
cost_effectiveness(strategy, cost, effectiveness)cost_effectiveness(strategy, cost, effectiveness)
strategy |
Character vector of strategy names. |
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
Object of class "EconCEA".
Computes the probability that an intervention is cost-effective across a range of willingness-to-pay (WTP) thresholds.
cost_effectiveness_acceptability_curve( incremental_cost, incremental_effect, wtp = seq(0, 1e+05, by = 1000) )cost_effectiveness_acceptability_curve( incremental_cost, incremental_effect, wtp = seq(0, 1e+05, by = 1000) )
incremental_cost |
Numeric vector of incremental costs. |
incremental_effect |
Numeric vector of incremental effects. |
wtp |
Numeric vector of willingness-to-pay thresholds. |
The Incremental Net Monetary Benefit (INMB) is computed as
where
= willingness-to-pay threshold
= incremental effect
= incremental cost
The CEAC is the proportion of simulations with INMB > 0.
An object of class "EconCEAC".
set.seed(1) cost <- rnorm(1000,500,100) effect <- rnorm(1000,0.35,0.08) ceac <- cost_effectiveness_acceptability_curve( incremental_cost=cost, incremental_effect=effect, wtp=seq(0,5000,100) )set.seed(1) cost <- rnorm(1000,500,100) effect <- rnorm(1000,0.35,0.08) ceac <- cost_effectiveness_acceptability_curve( incremental_cost=cost, incremental_effect=effect, wtp=seq(0,5000,100) )
Computes the Cost-Effectiveness Acceptability Frontier (CEAF) for multiple competing strategies.
cost_effectiveness_acceptability_frontier( cost, effect, wtp = seq(0, 1e+05, by = 1000) )cost_effectiveness_acceptability_frontier( cost, effect, wtp = seq(0, 1e+05, by = 1000) )
cost |
A numeric matrix of costs. Rows represent Monte Carlo simulations and columns represent competing strategies. |
effect |
A numeric matrix of effects with the same
dimensions as |
wtp |
A numeric vector of willingness-to-pay (WTP) thresholds. |
Net Monetary Benefit (NMB) is calculated as
where
is the willingness-to-pay threshold.
For each WTP threshold:
Expected NMB is calculated for every strategy.
The optimal strategy is identified.
The probability that this strategy is optimal is estimated.
An object of class "EconCEAF".
set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,120), rnorm(1000,1400,150) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.80,0.05), rnorm(1000,0.90,0.05) ) ceaf <- cost_effectiveness_acceptability_frontier( cost = cost, effect = effect )set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,120), rnorm(1000,1400,150) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.80,0.05), rnorm(1000,0.90,0.05) ) ceaf <- cost_effectiveness_acceptability_frontier( cost = cost, effect = effect )
Performs a simple decision tree analysis by calculating expected costs and expected effectiveness for terminal nodes.
decision_tree_analysis(strategy, probability, cost, effectiveness)decision_tree_analysis(strategy, probability, cost, effectiveness)
strategy |
Character vector of terminal strategy names. |
probability |
Numeric vector of probabilities. |
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
Expected values are calculated as:
An object of class "EconTree".
strategy <- c( "Treatment A", "Treatment B", "Treatment C" ) probability <- c( 0.30, 0.45, 0.25 ) cost <- c( 1200, 1800, 2400 ) effectiveness <- c( 0.70, 0.82, 0.91 ) tree <- decision_tree_analysis( strategy, probability, cost, effectiveness ) print(tree) summary(tree) plot(tree) as.data.frame(tree)strategy <- c( "Treatment A", "Treatment B", "Treatment C" ) probability <- c( 0.30, 0.45, 0.25 ) cost <- c( 1200, 1800, 2400 ) effectiveness <- c( 0.70, 0.82, 0.91 ) tree <- decision_tree_analysis( strategy, probability, cost, effectiveness ) print(tree) summary(tree) plot(tree) as.data.frame(tree)
Discounts one or more future cash flows to their present values.
discount_cashflow(cashflow, rate, period)discount_cashflow(cashflow, rate, period)
cashflow |
Numeric vector of cash flows. |
rate |
Discount rate expressed as a decimal (e.g., 0.10 for 10%). |
period |
Integer vector of time periods corresponding to each cash flow. |
The discounted cash flow is calculated as
where:
CF = Cash flow
r = Discount rate
t = Time period
An object of class "EconDCF".
discount_cashflow( cashflow = c(1000, 1200, 1500), rate = 0.10, period = 1:3 )discount_cashflow( cashflow = c(1000, 1200, 1500), rate = 0.10, period = 1:3 )
Calculates the discounted payback period of an investment.
discounted_payback_period(cashflow, rate)discounted_payback_period(cashflow, rate)
cashflow |
Numeric vector of cash flows. The first value should be the initial investment (negative). |
rate |
Discount rate expressed as a decimal. |
An object of class "EconDiscountedPayback".
dpb <- discounted_payback_period( cashflow = c(-50000,12000,15000,18000,20000), rate = 0.10 ) print(dpb)dpb <- discounted_payback_period( cashflow = c(-50000,12000,15000,18000,20000), rate = 0.10 ) print(dpb)
Identifies strongly dominated strategies.
dominance_analysis(strategy, cost, effectiveness)dominance_analysis(strategy, cost, effectiveness)
strategy |
Character vector of strategy names. |
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
A strategy is strongly dominated if another strategy has lower cost and greater or equal effectiveness.
An object of class "EconDominance".
dominance_analysis( strategy = c("A","B","C"), cost = c(1000,1200,900), effectiveness = c(0.70,0.75,0.80) )dominance_analysis( strategy = c("A","B","C"), cost = c(1000,1200,900), effectiveness = c(0.70,0.75,0.80) )
Computes the Expected Value of Partial Perfect Information (EVPPI) using regression-based approximation.
expected_value_partial_perfect_information( cost, effect, parameter, wtp = seq(0, 1e+05, by = 1000), method = "gam" )expected_value_partial_perfect_information( cost, effect, parameter, wtp = seq(0, 1e+05, by = 1000), method = "gam" )
cost |
Numeric matrix of costs. Rows are PSA simulations and columns are competing strategies. |
effect |
Numeric matrix of effects having the same
dimensions as |
parameter |
Numeric vector representing the uncertain parameter of interest. |
wtp |
Numeric vector of willingness-to-pay thresholds. |
method |
Regression method.
Currently only |
The EVPPI is estimated by regression of the Net Monetary Benefit (NMB) on the parameter of interest.
This implementation uses Generalized Additive Models
(mgcv::gam) to approximate the conditional expectation
of NMB.
An object of class "EconEVPPI".
## Not run: library(mgcv) set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,100) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.82,0.05) ) theta <- runif(1000) evppi <- expected_value_partial_perfect_information( cost = cost, effect = effect, parameter = theta ) ## End(Not run)## Not run: library(mgcv) set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,100) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.82,0.05) ) theta <- runif(1000) evppi <- expected_value_partial_perfect_information( cost = cost, effect = effect, parameter = theta ) ## End(Not run)
Computes the Expected Value of Perfect Information (EVPI) across a range of willingness-to-pay (WTP) thresholds using probabilistic sensitivity analysis results.
expected_value_perfect_information( cost, effect, wtp = seq(0, 1e+05, by = 1000) )expected_value_perfect_information( cost, effect, wtp = seq(0, 1e+05, by = 1000) )
cost |
A numeric matrix of costs. Rows represent Monte Carlo simulations and columns represent competing strategies. |
effect |
A numeric matrix of effectiveness values
with identical dimensions to |
wtp |
Numeric vector of willingness-to-pay thresholds. |
Net Monetary Benefit (NMB) is computed as
where
is the willingness-to-pay threshold.
EVPI is calculated as
where
is the expected value under
perfect information.
is the best expected value under
current information.
An object of class "EconEVPI".
set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,120), rnorm(1000,1500,140) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.82,0.05), rnorm(1000,0.92,0.05) ) evpi <- expected_value_perfect_information( cost = cost, effect = effect )set.seed(123) cost <- cbind( rnorm(1000,1000,100), rnorm(1000,1200,120), rnorm(1000,1500,140) ) effect <- cbind( rnorm(1000,0.70,0.05), rnorm(1000,0.82,0.05), rnorm(1000,0.92,0.05) ) evpi <- expected_value_perfect_information( cost = cost, effect = effect )
Calculates the Incremental Cost-Effectiveness Ratio (ICER) between two competing interventions.
icer(cost, effectiveness)icer(cost, effectiveness)
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
The ICER is calculated as
where
ΔCost = Difference in cost
ΔEffectiveness = Difference in effectiveness
An object of class "EconICER".
icer( cost = c(1000,1300,1700), effectiveness = c(0.60,0.75,0.90) )icer( cost = c(1000,1300,1700), effectiveness = c(0.60,0.75,0.90) )
Calculates the Internal Rate of Return (IRR).
internal_rate_return(cashflow, interval = c(-0.99, 10), tol = 1e-08)internal_rate_return(cashflow, interval = c(-0.99, 10), tol = 1e-08)
cashflow |
Numeric vector of cash flows. |
interval |
Search interval. |
tol |
Numerical tolerance. |
Object of class "EconIRR".
Calculates the Modified Internal Rate of Return (MIRR).
modified_internal_rate_return(cashflow, finance_rate, reinvest_rate)modified_internal_rate_return(cashflow, finance_rate, reinvest_rate)
cashflow |
Numeric vector of cash flows. |
finance_rate |
Finance rate (decimal). |
reinvest_rate |
Reinvestment rate (decimal). |
Object of class "EconMIRR".
mirr <- modified_internal_rate_return( cashflow = c(-50000,12000,15000,18000,20000), finance_rate = 0.08, reinvest_rate = 0.10 ) print(mirr)mirr <- modified_internal_rate_return( cashflow = c(-50000,12000,15000,18000,20000), finance_rate = 0.08, reinvest_rate = 0.10 ) print(mirr)
Performs deterministic multi-way sensitivity analysis.
multi_way_sensitivity_analysis(parameters, model)multi_way_sensitivity_analysis(parameters, model)
parameters |
A data.frame containing parameter values. |
model |
A function accepting one row (as a named list) and returning a single numeric outcome. |
An object of class "EconMWSA".
pars <- data.frame( Cost = c(1000,1200,1400), Effectiveness = c(0.70,0.75,0.82), Probability = c(0.90,0.85,0.80) ) model <- function(x){ x$Effectiveness * 5000 - x$Cost * x$Probability } mw <- multi_way_sensitivity_analysis( parameters = pars, model = model )pars <- data.frame( Cost = c(1000,1200,1400), Effectiveness = c(0.70,0.75,0.82), Probability = c(0.90,0.85,0.80) ) model <- function(x){ x$Effectiveness * 5000 - x$Cost * x$Probability } mw <- multi_way_sensitivity_analysis( parameters = pars, model = model )
Calculates the Net Health Benefit (NHB).
net_health_benefit(strategy, cost, effectiveness, willingness_to_pay)net_health_benefit(strategy, cost, effectiveness, willingness_to_pay)
strategy |
Character vector of strategy names. |
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
willingness_to_pay |
Numeric scalar representing the willingness-to-pay threshold. |
Net Health Benefit is calculated as
where
E = Effectiveness
C = Cost
λ = Willingness-to-pay threshold
An object of class "EconNHB".
nhb <- net_health_benefit( strategy = c("Current","Treatment A","Treatment B"), cost = c(1000,1300,1700), effectiveness = c(0.60,0.75,0.90), willingness_to_pay = 5000 ) print(nhb)nhb <- net_health_benefit( strategy = c("Current","Treatment A","Treatment B"), cost = c(1000,1300,1700), effectiveness = c(0.60,0.75,0.90), willingness_to_pay = 5000 ) print(nhb)
Calculates the Net Monetary Benefit (NMB).
net_monetary_benefit(strategy, cost, effectiveness, willingness_to_pay)net_monetary_benefit(strategy, cost, effectiveness, willingness_to_pay)
strategy |
Character vector of strategy names. |
cost |
Numeric vector of costs. |
effectiveness |
Numeric vector of effectiveness. |
willingness_to_pay |
Numeric scalar specifying the willingness-to-pay threshold per unit of effectiveness. |
Net Monetary Benefit is calculated as
where
= willingness-to-pay threshold
E = effectiveness
C = cost
An object of class "EconNMB".
nmb <- net_monetary_benefit( strategy = c("Current", "Treatment A", "Treatment B"), cost = c(1000, 1300, 1700), effectiveness = c(0.60, 0.75, 0.90), willingness_to_pay = 5000 ) print(nmb)nmb <- net_monetary_benefit( strategy = c("Current", "Treatment A", "Treatment B"), cost = c(1000, 1300, 1700), effectiveness = c(0.60, 0.75, 0.90), willingness_to_pay = 5000 ) print(nmb)
Calculates the Net Present Value (NPV) of a project.
net_present_value(cashflow, rate)net_present_value(cashflow, rate)
cashflow |
Numeric vector of cash flows. |
rate |
Discount rate expressed as a decimal. |
An object of class "EconNPV".
Performs deterministic one-way sensitivity analysis by varying a single parameter.
one_way_sensitivity_analysis(base_case, low, high, model)one_way_sensitivity_analysis(base_case, low, high, model)
base_case |
Numeric scalar. |
low |
Lower value. |
high |
Upper value. |
model |
Function returning the outcome. |
Object of class "EconOWSA".
Performs a complete partial budget analysis.
partial_budget(added_returns, reduced_costs, added_costs, reduced_returns)partial_budget(added_returns, reduced_costs, added_costs, reduced_returns)
added_returns |
Numeric vector. |
reduced_costs |
Numeric vector. |
added_costs |
Numeric vector. |
reduced_returns |
Numeric vector. |
Object of class "EconPB".
partial_budget( added_returns = c(5000,2500), reduced_costs = c(1500,500), added_costs = c(2000,1000), reduced_returns = c(500) )partial_budget( added_returns = c(5000,2500), reduced_costs = c(1500,500), added_costs = c(2000,1000), reduced_returns = c(500) )
Calculates the payback period of an investment.
payback_period(cashflow)payback_period(cashflow)
cashflow |
Numeric vector of cash flows. The first value should be the initial investment (negative). |
The payback period is the time required for cumulative cash inflows to recover the initial investment. Linear interpolation is used when recovery occurs during a period.
An object of class "EconPayback".
pb <- payback_period( cashflow = c(-50000,12000,15000,18000,20000) ) print(pb)pb <- payback_period( cashflow = c(-50000,12000,15000,18000,20000) ) print(pb)
Produces a bar chart comparing total benefits and total costs.
## S3 method for class 'EconBCR' plot(x, ...)## S3 method for class 'EconBCR' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments passed to
|
Invisibly returns the midpoints of the bars.
x <- benefit_cost_ratio( benefit = 150000, cost = 100000 ) plot(x)x <- benefit_cost_ratio( benefit = 150000, cost = 100000 ) plot(x)
Produces a visualization of the annual incremental budget impact and cumulative budget impact over time.
## S3 method for class 'EconBIA' plot(x, type = c("annual", "cumulative"), ...)## S3 method for class 'EconBIA' plot(x, type = c("annual", "cumulative"), ...)
x |
An object of class |
type |
Type of plot. One of:
|
... |
Additional graphical arguments. |
Produces a budget impact plot.
## Not run: plot(bia) plot(bia, type = "cumulative") ## End(Not run)## Not run: plot(bia) plot(bia, type = "cumulative") ## End(Not run)
Plot Cost-Effectiveness Plane
## S3 method for class 'EconCEA' plot(x, ...)## S3 method for class 'EconCEA' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
A Cost-Effectiveness Plane.
Produces a Cost-Effectiveness Acceptability Curve (CEAC) showing the probability that an intervention is cost-effective over a range of willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconCEAC' plot(x, ...)## S3 method for class 'EconCEAC' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a CEAC plot.
Produces a Cost-Effectiveness Acceptability Frontier (CEAF) showing the probability that the optimal strategy is cost-effective over a range of willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconCEAF' plot(x, ...)## S3 method for class 'EconCEAF' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a CEAF plot.
## Not run: plot(ceaf) ## End(Not run)## Not run: plot(ceaf) ## End(Not run)
Produces an Expected Value of Perfect Information (EVPI) curve across willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconEVPI' plot(x, ...)## S3 method for class 'EconEVPI' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces an EVPI plot.
## Not run: plot(evpi) ## End(Not run)## Not run: plot(evpi) ## End(Not run)
Produces an Expected Value of Partial Perfect Information (EVPPI) curve across willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconEVPPI' plot(x, ...)## S3 method for class 'EconEVPPI' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces an EVPPI plot.
## Not run: plot(evppi) ## End(Not run)## Not run: plot(evppi) ## End(Not run)
Plot Multi-Way Sensitivity Analysis
## S3 method for class 'EconMWSA' plot(x, ...)## S3 method for class 'EconMWSA' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a line plot of model outcomes.
Displays the distribution of simulated outcomes.
## S3 method for class 'EconPSA' plot(x, ...)## S3 method for class 'EconPSA' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a histogram with density curve.
Plot Threshold Analysis
## S3 method for class 'EconThreshold' plot(x, ...)## S3 method for class 'EconThreshold' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a threshold analysis plot.
Plot Tornado Diagram
## S3 method for class 'EconTornado' plot(x, ...)## S3 method for class 'EconTornado' plot(x, ...)
x |
An object of class |
... |
Additional graphical arguments. |
Produces a bar plot of expected costs or expected effectiveness for each terminal strategy.
## S3 method for class 'EconTree' plot(x, type = c("cost", "effectiveness"), ...)## S3 method for class 'EconTree' plot(x, type = c("cost", "effectiveness"), ...)
x |
An object of class |
type |
Character string specifying the quantity to
plot. One of |
... |
Additional graphical arguments. |
Produces a bar plot.
## Not run: plot(tree) plot(tree, type = "effectiveness") ## End(Not run)## Not run: plot(tree) plot(tree, type = "effectiveness") ## End(Not run)
Calculates the present value of one or more future cash flows.
present_value(future_value, rate, period)present_value(future_value, rate, period)
future_value |
Numeric vector of future values. |
rate |
Discount rate expressed as a decimal. |
period |
Integer vector of periods. |
Present value is calculated as
where
FV = Future Value
r = Discount rate
t = Time period
An object of class "EconPV".
pv <- present_value( future_value = c(1000,1500,2000), rate = 0.10, period = 1:3 ) print(pv)pv <- present_value( future_value = c(1000,1500,2000), rate = 0.10, period = 1:3 ) print(pv)
Print an EconBCR object
## S3 method for class 'EconBCR' print(x, ...)## S3 method for class 'EconBCR' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
Invisibly returns the object.
Print a Budget Impact Analysis Object
## S3 method for class 'EconBIA' print(x, ...)## S3 method for class 'EconBIA' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print a Cost-Effectiveness Acceptability Curve Object
## S3 method for class 'EconCEAC' print(x, ...)## S3 method for class 'EconCEAC' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print a Cost-Effectiveness Acceptability Frontier Object
## S3 method for class 'EconCEAF' print(x, ...)## S3 method for class 'EconCEAF' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print an Expected Value of Perfect Information Object
## S3 method for class 'EconEVPI' print(x, ...)## S3 method for class 'EconEVPI' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print an Expected Value of Partial Perfect Information Object
## S3 method for class 'EconEVPPI' print(x, ...)## S3 method for class 'EconEVPPI' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print a Probabilistic Sensitivity Analysis Object
## S3 method for class 'EconPSA' print(x, ...)## S3 method for class 'EconPSA' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print a Tornado Diagram Object
## S3 method for class 'EconTornado' print(x, ...)## S3 method for class 'EconTornado' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Print a Decision Tree Analysis Object
## S3 method for class 'EconTree' print(x, ...)## S3 method for class 'EconTree' print(x, ...)
x |
An object of class |
... |
Additional arguments (unused). |
The input object, invisibly.
Performs Monte Carlo simulation for economic evaluation.
probabilistic_sensitivity_analysis(n = 1000, sampler, model, seed = NULL)probabilistic_sensitivity_analysis(n = 1000, sampler, model, seed = NULL)
n |
Integer. Number of Monte Carlo simulations. |
sampler |
A function generating one random parameter set. The function should return a list. |
model |
A function accepting the sampled parameter list and returning a single numeric outcome. |
seed |
Optional integer random seed. |
This function performs probabilistic sensitivity analysis
(PSA) using Monte Carlo simulation. During each iteration,
random parameters are generated by sampler() and passed
to model(). The model must return one finite numeric
outcome.
An object of class "EconPSA".
sampler <- function() { list( cost = rnorm(1, 1000, 100), effectiveness = rbeta(1, 20, 5) ) } model <- function(par) { par$effectiveness * 5000 - par$cost } psa <- probabilistic_sensitivity_analysis( n = 1000, sampler = sampler, model = model, seed = 123 )sampler <- function() { list( cost = rnorm(1, 1000, 100), effectiveness = rbeta(1, 20, 5) ) } model <- function(par) { par$effectiveness * 5000 - par$cost } psa <- probabilistic_sensitivity_analysis( n = 1000, sampler = sampler, model = model, seed = 123 )
Calculates the Profitability Index (PI).
profitability_index(cashflow, rate)profitability_index(cashflow, rate)
cashflow |
Numeric vector of cash flows. |
rate |
Discount rate. |
Object of class "EconPI".
Summarize an EconBCR object
## S3 method for class 'EconBCR' summary(object, ...)## S3 method for class 'EconBCR' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame summarizing the benefit-cost analysis.
Returns a summary of the annual and cumulative budget impact over the specified time horizon.
## S3 method for class 'EconBIA' summary(object, ...)## S3 method for class 'EconBIA' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing annual budget impact results.
## Not run: summary(bia) ## End(Not run)## Not run: summary(bia) ## End(Not run)
Summarize a Cost-Effectiveness Analysis
## S3 method for class 'EconCEA' summary(object, ...)## S3 method for class 'EconCEA' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame summarizing the cost-effectiveness analysis.
Summarize a Cost-Effectiveness Acceptability Curve Object
## S3 method for class 'EconCEAC' summary(object, ...)## S3 method for class 'EconCEAC' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame summarizing the Cost-Effectiveness Acceptability Curve.
Returns a summary of the Cost-Effectiveness Acceptability Frontier (CEAF) results across all willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconCEAF' summary(object, ...)## S3 method for class 'EconCEAF' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Willingness-to-pay threshold.
Optimal strategy at each WTP.
Probability that the optimal strategy is truly cost-effective.
Expected Net Monetary Benefit.
## Not run: summary(ceaf) ## End(Not run)## Not run: summary(ceaf) ## End(Not run)
Returns a summary of the Expected Value of Perfect Information (EVPI) across willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconEVPI' summary(object, ...)## S3 method for class 'EconEVPI' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Willingness-to-pay threshold.
Expected Value of Perfect Information.
Expected value under perfect information,
.
Expected value under current information,
.
## Not run: summary(evpi) ## End(Not run)## Not run: summary(evpi) ## End(Not run)
Returns a summary of the Expected Value of Partial Perfect Information (EVPPI) across willingness-to-pay (WTP) thresholds.
## S3 method for class 'EconEVPPI' summary(object, ...)## S3 method for class 'EconEVPPI' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Willingness-to-pay threshold.
Expected Value of Partial Perfect Information.
## Not run: summary(evppi) ## End(Not run)## Not run: summary(evppi) ## End(Not run)
Summarize a Probabilistic Sensitivity Analysis Object
## S3 method for class 'EconPSA' summary(object, ...)## S3 method for class 'EconPSA' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing summary statistics.
Summarize a Tornado Diagram Object
## S3 method for class 'EconTornado' summary(object, ...)## S3 method for class 'EconTornado' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame summarizing the tornado analysis.
Returns a summary of the expected costs and expected effectiveness for each terminal node.
## S3 method for class 'EconTree' summary(object, ...)## S3 method for class 'EconTree' summary(object, ...)
object |
An object of class |
... |
Additional arguments (unused). |
A data frame containing:
Terminal strategy.
Terminal node probability.
Observed cost.
Observed effectiveness.
Expected cost.
Expected effectiveness.
## Not run: summary(tree) ## End(Not run)## Not run: summary(tree) ## End(Not run)
Identifies the threshold value of a parameter at which a model outcome reaches a specified target.
threshold_analysis(lower, upper, target = 0, model, tol = 1e-08)threshold_analysis(lower, upper, target = 0, model, tol = 1e-08)
lower |
Lower search bound. |
upper |
Upper search bound. |
target |
Target outcome. |
model |
Function returning the model outcome. |
tol |
Numerical tolerance. |
Object of class "EconThreshold".
Creates data for a tornado diagram.
tornado_diagram(parameter, low, high, base_case)tornado_diagram(parameter, low, high, base_case)
parameter |
Character vector of parameter names. |
low |
Numeric vector of outcomes at the low value. |
high |
Numeric vector of outcomes at the high value. |
base_case |
Numeric scalar. |
Object of class "EconTornado".
Performs deterministic two-way sensitivity analysis by varying two model parameters simultaneously.
two_way_sensitivity_analysis(parameter1, parameter2, model)two_way_sensitivity_analysis(parameter1, parameter2, model)
parameter1 |
Numeric vector of values for parameter 1. |
parameter2 |
Numeric vector of values for parameter 2. |
model |
Function accepting two arguments and returning a numeric outcome. |
An object of class "EconTWSA".