pp_f2: Power plot for Cohen's f2

View source: R/power.R

pp_f2R Documentation

Power plot for Cohen's f2

Description

Power plot for Cohen's f2

Usage

pp_f2(
  data,
  N,
  u1 = 1,
  u2 = 0,
  sig.level = 0.05,
  min_pwr = NULL,
  effect = .data$f2,
  labels = .data$f2
)

Arguments

data

tibble of effect size data

N

total sample sizes for which to compute power

u1

degrees of freedom for effect generator

u2

degrees of freedom for other predictors (1 + u1 + u2 + v = N)

sig.level

significance level (Type I error probability)

min_pwr

minimum desirable power to label (NULL for no label)

effect

variable in data representing the effect sizes

labels

effect labels to be used for legend

Value

object of class "ggplot"

Note

The effect variable is converted to factor in the given order and labels applied respectively.

References

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.

See Also

ggplot, pwr.f2.test

Examples

## Exercise 9.1 P. 424 from Cohen (1988)
dplyr::tibble(
  f2 = 0.1 / (1 - 0.1),
  y = "sales",
  x = "demographics",
  source = "Cohen (1988)"
) %>%
  pp_f2(85:105,
    u1 = 5,
    labels = sprintf("%s %s", format(round(f2, 2), nsmall = 2), source)
  )

the-mad-statter/washu documentation built on May 5, 2024, 10:26 a.m.