pp_d | R Documentation |
Power plot for Cohen's d and dz
pp_d(
data,
n,
type = c("two.sample", "one.sample", "paired"),
alternative = c("two.sided", "less", "greater"),
sig.level = 0.05,
min_pwr = NULL,
effect = .data$d,
labels = .data$d
)
data |
tibble of effect size data |
n |
sample sizes per sample for which to compute power |
type |
type of t test : one- two- or paired-samples |
alternative |
a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less" |
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 |
object of class "ggplot"
The effect variable is converted to factor in the given order and labels applied respectively.
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale,NJ: Lawrence Erlbaum.
ggplot
, pwr.t.test
## Exercise 2.1 P. 40 from Cohen (1988)
dplyr::tibble(
d = .50,
y = "learning",
x = "opportunity",
source = "Cohen (1988)"
) %>%
pp_d(15:45,
labels = sprintf("%s %s", format(round(d, 2), nsmall = 2), source)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.