wilcox.pow: Compute Power for the Wilcoxon and T Tests

View source: R/wilcox.pow.R

wilcox.powR Documentation

Compute Power for the Wilcoxon and T Tests

Description

Computes an approximation to the power of the Wilcoxon signed rank or two-sample Wilcoxon rank sum test and one- or two-sample t-tests

Usage

wilcox.pow(n1, n2 = NULL, del, alpha2 = 0.05, tdist = FALSE)

Arguments

n1

sample size in group 1

n2

Sample size in group 2. If NULL, assumes a 1-sample test.

del

difference as a fraction of the population standard deviation

alpha2

two-sided significance level

tdist

if TRUE, uses t distribution for the critical value; if FALSE, uses a normal critical value

Details

Uses an approximations given in Lehman, Nonparametrics: Statistical Methods Based on Ranks, for the power of the Wilcoxon signed rank and two-sample Wilcoxon test. Assumes the data on a transformed scale is normally distributed with constant variances. The difference del is a location shift on this transformed scale, expressed as a fraction of the common standard deviation.

The critical value from the t-distribution with n1-1 (one-sample) or n1+n2-2 (two-sample) degrees of freedom can be used instead of the standard normal by specifying tdist=TRUE. However, the rejection probability is still computed using the normal distribution.

Value

A vector of length two giving the power for the Wilcoxon (first component) and t (second component) tests.

Examples

wilcox.pow(24, 24, 1)
wilcox.pow(24, 10, 1)
wilcox.pow(10, NULL, 0.5) ## one-sample test


raredd/desmon documentation built on May 7, 2024, 3:46 p.m.