pwr.prop.test.contour: Plot a Power Contour for a proportion test

Description Usage Arguments Value Author(s) Examples

View source: R/convenience.R

Description

Plot a contour of sample size, effect size and power for proportion test comparisons in the style of Richard Morey's jpower JAMOVI module.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
pwr.prop.test.contour(
  nmin,
  nmax,
  propmin,
  propmax,
  propcomp = 0.5,
  sig.level = 0.05,
  type = c("two.sample", "one.sample"),
  alternative = c("two.sided", "less", "greater"),
  pwrbands = c(0.5, 0.8, 0.95),
  alpha = 0.6
)

Arguments

nmin

Minimum sample size for the plot.

nmax

Maximum sample size for the plot.

propmin

Minimum proportion for the plot.

propmax

Maximum proportion for the plot.

propcomp

Comparison proportion value against which the measured proportion is compared.

sig.level

Significance level, or alpha. Defaults to 0.05.

type

The proportion test type. The default is "two.sample", but another option is "one.sample".

alternative

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

pwrbands

Additional black power bands to display on the figure to emphasise certain power levels. Defaults to c(0.5, 0.8, 0.95).

alpha

The transparency of the contours, in order to show grid lines below.

Value

A ggplot2 object.

Author(s)

Granville J Matheson, mathesong@gmail.com

Examples

1
pwr.prop.test.contour(5, 100, 0.1, 0.9)

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