Learn R Programming

powerbrmsINLA (version 1.1.1)

plot_assurance_with_robustness: Plot Assurance with Robustness Ribbon (Multi-Effect Grid Friendly)

Description

Compares assurance results from multiple scenarios by showing the range ("ribbon") of values across scenarios for each sample size and effect grid variable.

Usage

plot_assurance_with_robustness(
  power_results_list,
  metric = c("precision", "direction", "threshold", "bf"),
  x_effect = NULL,
  facet_by = NULL,
  precision_target = NULL,
  p_star = 0.95,
  bf_threshold = 10,
  effect_filters = NULL,
  effect_weights = NULL,
  show_individual_scenarios = FALSE,
  title = NULL,
  subtitle = NULL
)

Value

A ggplot object.

Arguments

power_results_list

Named list of results objects from brms_inla_power or sequential/two-stage variants.

metric

Which assurance metric to compute: "precision", "direction", "threshold", or "bf".

x_effect

Name of effect grid column for x-axis (default: first detected grid column).

facet_by

Optional effect grid column(s) to facet by.

precision_target

CI width target if metric="precision".

p_star

Posterior probability threshold for "direction"/"threshold".

bf_threshold

BF10 threshold for "bf".

effect_filters

Optional named list for filtering rows (e.g. list(treatment=0)).

effect_weights

Optional named numeric vector for averaging over grid values.

show_individual_scenarios

Logical; if TRUE, overlay each scenario's curve.

title, subtitle

Optional plot labels.