Learn R Programming

powerbrmsINLA (version 1.1.1)

plot_power_contour: Draw a filled contour plot of assurance for a chosen metric, as a function of two effect grid columns and sample size.

Description

Draw a filled contour plot of assurance for a chosen metric, as a function of two effect grid columns and sample size.

Usage

plot_power_contour(
  power_results,
  power_metric = c("direction", "threshold", "rope"),
  x_effect = NULL,
  y_effect = "n",
  facet_by = NULL,
  power_threshold = 0.8,
  show_threshold_line = TRUE,
  title = NULL,
  subtitle = NULL
)

Value

A ggplot object.

Arguments

power_results

Output from a brms_inla_power function.

power_metric

Which metric to plot: "direction", "threshold", or "rope".

x_effect

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

y_effect

Name of effect grid column for y-axis (default = "n").

facet_by

Optional effect grid column(s) to facet by.

power_threshold

Optional contour line for assurance (default 0.8).

show_threshold_line

Logical; add a red contour at power_threshold.

title, subtitle

Optional plot labels.