relrisk: Power calculation for relative risk

relriskR Documentation

Power calculation for relative risk

Description

Performs power and sample size calculations for a test of relative risk, p2/p1. Can solve for power, N1, n.ratio or alpha.

Usage

relrisk(
  n1 = NULL,
  n.ratio = 1,
  p1 = NULL,
  p2 = NULL,
  RR0 = 1,
  alpha = 0.05,
  power = NULL,
  sides = 2,
  v = FALSE
)

Arguments

n1

The sample size for group 1.

n.ratio

The ratio n2/n1 between the sample sizes of two groups; defaults to 1 (equal group sizes).

p1

The proportion in group 1.

p2

The proportion in group 2.

RR0

The relative risk under the null (p2/p1); defaults to 1.

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

relrisk(n1 = NULL, n.ratio = 1/6, p1 = 0.1, p2 = 0.1 * 2, power = 0.8)

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