Learn R Programming

decisionSupport (version 1.114)

plot_evpi: Visualizing the results of Expected Value of Perfect Information (EVPI) analysis for various types of Monte Carlo simulation results

Description

Plotting the Expected Value of Perfect Information (EVPI) of Monte Carlo outputs

Usage

plot_evpi(
  EVPIresults,
  decision_vars,
  input_table = NULL,
  new_names = NULL,
  unit = NULL,
  x_axis_name = "Expected Value of Perfect Information",
  y_axis_name = NULL,
  bar_color = "cadetblue",
  base_size = 11,
  ...
)

Value

This function returns a plot of classes 'gg', and 'ggplot'. This allows the user to continue editing some features of the plots through the syntax '+'.

Arguments

EVPIresults

are the results of the multi_EVPI function

decision_vars

are the names of the decision variables in the output of the mcSimulation function

input_table

is a data frame with at least two columns named 'variable' and 'label'. The 'variable column should have one entry for the name of each variable contained in any of the plots. In preparing the figure, the function will replace the variable names with the labels. If the label is missing then the plot will show 'NA' in the place of the variable name. Default is NULL and uses the original variable names.

new_names

are the reformatted replacement names of the decision variables in the output of the mcSimulation function

unit

is the symbol to display before the evpi value on the x axis. It accepts text or (many) unicode formatted symbol text

x_axis_name

is the name (character string) to be passed to the x-axis title. Default is "Expected Value of Perfect Information" and allows allow the user to add a customized axis title

y_axis_name

is the name (character string) to be passed to the y-axis title. Default is NULL to allow the user to add a customized axis title

bar_color

is the color to be used for the EVPI barplot. Default is "cadetblue"

base_size

is the base text size to be used for the plot. The default is 11, this is the ggplot2::ggtheme default

...

accepts arguments to be passed to ggplot2::ggtheme

Author

Eduardo Fernandez (efernand@uni-bonn.de)

Cory Whitney (cory.whitney@uni-bonn.de)

References

Do, Hoa, Eike Luedeling, and Cory Whitney. “Decision Analysis of Agroforestry Options Reveals Adoption Risks for Resource-Poor Farmers.” Agronomy for Sustainable Development 40, no. 3 (June 2020): 20. tools:::Rd_expr_doi("10.1007/s13593-020-00624-5"). Lanzanova, Denis, Cory Whitney, Keith Shepherd, and Eike Luedeling. “Improving Development Efficiency through Decision Analysis: Reservoir Protection in Burkina Faso.” Environmental Modelling & Software 115 (May 1, 2019): 164–75. tools:::Rd_expr_doi("10.1016/j.envsoft.2019.01.016"). Luedeling, Eike, and Keith Shepherd. “Decision-Focused Agricultural Research.” Solutions 7, no. 5 (2016): 46–54. https://apps.worldagroforestry.org/downloads/Publications/PDFS/JA16154.pdf

Examples

Run this code

# Create a data.frame

montecarlo <- data.frame(indep1 = rnorm(1000, sd = 50, mean = 100), 
                         indep2 = rnorm(1000, sd = 100, mean = 100))
montecarlo[, 'output1'] <- montecarlo[, 'indep1'] * montecarlo[, 'indep2']
montecarlo[, 'output2'] <- (montecarlo[, 'indep1'] * (montecarlo[, 'indep2']) + 10)

# Run the multi_EVPI function 
 
results_all <- multi_EVPI(montecarlo,"output1")

plot_evpi(results_all, decision_vars = c("output1", "output2"), 
new_names = c("Decision option 1", "Decision option 2"))

Run the code above in your browser using DataLab