pwr.prop.test.table: Create a Power Table for a proportion test

Description Usage Arguments Value Author(s) Examples

View source: R/convenience.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pwr.prop.test.table(
  n,
  propcomp = 0.5,
  sig.level = 0.05,
  type = c("two.sample", "one.sample"),
  alternative = c("two.sided", "less", "greater"),
  kable = TRUE,
  digits = 3,
  ...
)

Arguments

n

The proposed sample size.

propcomp

Comparison proportion value against which the measured proportion is compared.

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".

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

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".

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.