Learn R Programming

powerprior (version 1.0.0)

plot_sensitivity: Plot Sensitivity Analysis

Description

Creates a plot showing how posterior estimates vary with the discounting parameter.

Usage

plot_sensitivity(comparison_results, parameter = "mu", dimension = 1)

Value

A ggplot2 object (if ggplot2 is available) or base R plot

Arguments

comparison_results

Output from compare_discounting()

parameter

Name of parameter to plot (default: "mu")

dimension

For multivariate case, which dimension to plot (default: 1)

Examples

Run this code
# \donttest{
set.seed(123)
historical <- rnorm(50, mean = 10, sd = 2)
current <- rnorm(30, mean = 10.5, sd = 2)

comparison <- compare_discounting(historical, current)
plot_sensitivity(comparison)
# }

Run the code above in your browser using DataLab