prop.1samp: Power calculation for one-sample proportion test

prop.1sampR Documentation

Power calculation for one-sample proportion test

Description

Performs power and sample size calculations for a one-sample test of a proportion. Calculations use the large-sample normal approximation to the binomial. Can solve for power, N or alpha.

Usage

prop.1samp(
  N = NULL,
  p0 = NULL,
  pA = NULL,
  alpha = 0.05,
  power = NULL,
  sides = 2,
  v = FALSE
)

Arguments

N

The sample size.

p0

The proportion under the null.

pA

The true proportion.

alpha

The significance level (type 1 error rate); defaults to 0.05.

power

The specified level of power.

sides

Either 1 or 2 (default) to specify a one- or two- sided hypothesis test.

v

Either TRUE for verbose output or FALSE (default) to output computed argument only.

Value

A list of the arguments (including the computed one).

Examples

prop.1samp(N = NULL, p0 = 0.2, pA = 0.3, power = 0.8, sides = 1)
prop.1samp(N = NULL, p0 = 0.4, pA = 0.5, power = 0.8, sides = 1)


powertools documentation built on April 4, 2025, 5:02 a.m.