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

Description Usage Arguments Details Value Author(s) References Examples

View source: R/n.wilcox.ord.R

Description

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

Usage

1
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

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.

Value

total sample size

Total sample size

m

Sample size group 1

n

Sample size group 2

Author(s)

Ralph Scherer

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

1
2
3
4
5
## 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))

Example output

$`total sample size`
[1] 8390

$m
[1] 3943

$n
[1] 4447

samplesize documentation built on May 29, 2017, 6:59 p.m.