power_prop_test: Power Calculations for Two-Sample Test for Proportions with...

power_prop_testR Documentation

Power Calculations for Two-Sample Test for Proportions with unequal sample size

Description

Compute power of test, or determine parameters to obtain target power for equal and unequal sample sizes.

Usage

power_prop_test(
  n = NULL,
  p1 = NULL,
  p2 = NULL,
  sig.level = 0.05,
  power = NULL,
  ratio = 1,
  alternative = c("two.sided", "one.sided"),
  tol = .Machine$double.eps^0.25
)

Arguments

n

Number of observations (in group 1)

p1

Probability in one group

p2

Probability in other group

sig.level

Significance level (Type I error probability)

power

Power of test (1 minus Type II error probability)

ratio

The ratio n2/n1 between the larger group and the smaller group. Should be a value equal to or greater than 1 since n2 is the larger group. Defaults to 1 (equal group sizes)

alternative

String. Can be one- or two-sided test. Can be abbreviated.

tol

Numerical tolerance used in root finding, the default providing (at least) four significant digits

Details

Exactly one of the parameters n, delta, power, sd, sig.level, ratio sd.ratio must be passed as NULL, and that parameter is determined from the others. Notice that the last two have non-NULL defaults so NULL must be explicitly passed if you want to compute them.

Value

Object of class power.htest, a list of the arguments (including the computed one) augmented with method and note elements.

Note

uniroot is used to solve power equation for unknowns, so you may see errors from it, notably about inability to bracket the root when invalid arguments are given.

Author(s)

Claus Ekstrom claus@rprimer.dk

See Also

power.prop.test, power_t_test, power.t.test

Examples

power_prop_test(n=NULL, p1=.65, p2=.85, power=.8, ratio=2)

MESS documentation built on Aug. 21, 2023, 1:05 a.m.

Related to power_prop_test in MESS...