plot_power_curves: Plot Power Curves

View source: R/plot-power-curves.R

plot_power_curvesR Documentation

Plot Power Curves

Description

Uses stats::power.t.test() to generate power values and plots of multiple power curves.

Usage

plot_power_curves(
  delta_vec = c(0.5, 2, 0.1),
  power_vec = seq(0.5, 0.9, 0.1),
  alpha = 0.05,
  main = NULL
)

Arguments

delta_vec

numeric(n). A sequence of effect sizes to evaluate the corresponding power.

power_vec

numeric(n) in ⁠(0, 1)⁠. A sequence of power levels to evaluate the required samples size.

alpha

double(1). The significance threshold (\alpha), the probability of a significant result given the null hypothesis, i.e. a false positive. If desired, Bonferroni correction should be implemented here.

main

character(1). Optional title.

Value

A ggplot.

Author(s)

Stu Field

See Also

stats::power.t.test()

Examples

plot_power_curves(delta_vec = seq(0.5, 2, 0.1),
                  power_vec = seq(0.5, 0.9, 0.1))

stufield/power documentation built on June 1, 2025, 7:16 p.m.