ztest.paired: Power calculation for paired z test

ztest.pairedR Documentation

Power calculation for paired z test

Description

This function performs power and sample size calculations for a paired z test which is analogous to a paired t test with variance assumed to be known. This function is provided largely for pedagogical purposes; in general, for real studies, the paired t test procedure should be used.

Usage

ztest.paired(
  N = NULL,
  delta = NULL,
  sd1 = 1,
  sd2 = 1,
  rho = NULL,
  alpha = 0.05,
  power = NULL,
  sides = 2,
  v = FALSE
)

Arguments

N

The sample size; the number of pairs.

delta

DeltaA (the true mean difference) - Delta0 (the mean difference under the null).

sd1

The pre standard deviation; defaults to 1.

sd2

The post standard deviation; defaults to 1.

rho

The correlation between pre and post measurements on the same individual; defaults to 0.

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

ztest.paired(N = NULL, delta = 4, sd1 = 10, sd2 = 10, rho = 0.4, power = 0.8, sides = 2)

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