Skip to contents

Renders an anovapowersim_curve as a ggplot2 line + ribbon with a horizontal reference at requested power values and, when auto-search was used, a vertical marker at the estimated required total sample size.

Usage

plot_power_curve(
  x,
  show_target = TRUE,
  power_lines = NULL,
  show_n_needed = TRUE,
  ...
)

Arguments

x

An anovapowersim_curve object from power_curve().

show_target

Logical; draw the horizontal target power line (default TRUE).

power_lines

Optional numeric vector of additional power reference lines, e.g. c(.80, .90).

show_n_needed

Logical; draw the vertical line at n_needed (default TRUE).

...

Unused, for S3 consistency.

Value

A ggplot object.

See also

Examples

if (FALSE) { # \dontrun{
pc <- power_curve(
  between = c(group = 2),
  within = c(time = 2),
  term = "group:time",
  target_pes = 0.2,
  n_range = c(10, 20, 30),
  n_sims = 200
)
plot_power_curve(pc)
} # }