Learn R Programming

samplesize (version 0.2-4)

n.wilcox.ord: Sample size for Wilcoxon-Mann-Whitney for ordinal data

Description

Function computes sample size for the two-sided Wilcoxon test when applied to two independent samples with ordered categorical responses.

Usage

n.wilcox.ord(power = 0.8, alpha = 0.05, t, p, q)

Arguments

power
required Power
alpha
required two-sided Type-I-error level
t
sample size fraction n/N, where n is sample size of group B and N is the total sample size
p
vector of expected proportions of the categories in group A, should sum to 1
q
vector of expected proportions of the categories in group B, should be of equal length as p and should sum to 1

Value

Details

This function approximates the total sample size, N, needed for the two-sided Wilcoxon test when comparing two independent samples, A and B, when data are ordered categorical according to Equation 12 in Zhao et al.(2008). Assuming that the response consists of D ordered categories $C_1 ,..., C_D$. The expected proportions of these categories in two treatments A and B must be specified as numeric vectors $p_1,...,p_D$ and $q_1,...,q_D$, respectively. The argument t allows to compute power for an unbalanced design, where $t=n_B/N$ is the proportion of sample size in treatment B.

References

Zhao YD, Rahardja D, Qu Yongming. Sample size calculation for the Wilcoxon-Mann-Whitney test adjsuting for ties. Statistics in Medicine 2008; 27:462-468

Examples

Run this code
## example out of:
## Zhao YD, Rahardja D, Qu Yongming. 
## Sample size calculation for the Wilcoxon-Mann-Whitney test adjsuting for ties. 
## Statistics in Medicine 2008; 27:462-468
n.wilcox.ord(power = 0.8, alpha = 0.05, t = 0.53, p = c(0.66, 0.15, 0.19), q = c(0.61, 0.23, 0.16))

Run the code above in your browser using DataLab