pwr.t.test.table: Create a Power Table for a t-test comparison

Description Usage Arguments Value Author(s) Examples

View source: R/convenience.R

Description

Plot a power analysis table of effect size and power for t-test comparisons in the style of Richard Morey's jpower JAMOVI module.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pwr.t.test.table(
  n,
  sig.level = 0.05,
  type = c("two.sample", "one.sample", "paired"),
  alternative = c("two.sided", "less", "greater"),
  d_unitconversion = 1,
  d_units = "Cohen's d",
  kable = TRUE,
  digits = 3,
  ...
)

Arguments

n

The proposed sample size.

sig.level

Significance level, or alpha. Defaults to 0.05.

type

The t-test type. The default is "two.sample", but other options are "paired" or "one.sample".

alternative

The alternative hypothesis. The default is "two.sided", but other options are "less" or "greater".

d_unitconversion

Unit conversion of Cohen's d. If specified as 5, for example, 5 units of change in the units of the table are considered equivalent to Cohen's d = 1. This conversion should be calculated in advance. Defaults to 1 for Cohen's d.

d_units

The units of the difference. Defaults to "Cohen's d".

kable

Should the table be presented as a knitr::kable() figure? Defaults to TRUE. Otherwise a tibble is returned.

digits

The number of digits.

...

Extra input arguments for the knitr::kable() function

Value

A power table.

Author(s)

Granville J Matheson, mathesong@gmail.com

Examples

1
2
3
4
5
# Straightforward example
pwr.t.test.table(n=25)

# More customised example
pwr.t.test.table(n=25, d_unitconversion=20, d_units="%", digits=1)

mathesong/pwrcontour documentation built on Jan. 1, 2021, 9:19 a.m.