TWOSAMPLEWILCOXON
<options> ;
The TWOSAMPLEWILCOXON statement performs power and sample size analyses for the WilcoxonMannWhitney test (also called the Wilcoxon ranksum test, MannWhitneyWilcoxon test, or MannWhitney U test) for two independent groups.
Note that the O’BrienCastelloe approach to computing power for the Wilcoxon test is approximate, based on asymptotic behavior as the total sample size gets large. The quality of the power approximation degrades for small sample sizes; conversely, the quality of the sample size approximation degrades if the two distributions are far apart, so that only a small sample is needed to detect a significant difference. But this degradation is rarely a problem in practical situations, in which experiments are usually performed for relatively close distributions.
Table 75.25 summarizes the options available in the TWOSAMPLEWILCOXON statement.
Table 75.25: TWOSAMPLEWILCOXON Statement Options
Option 
Description 

Define analysis 

Specifies the statistical analysis 

Specify analysis information 

Specifies the significance level 

Specifies the number of sides and the direction of the statistical test 

Specify distributions 

Defines a distribution for a variable 

Specifies the distributions of two or more variables 

Specify sample size and allocation 

Specifies the two group sample sizes 

Specifies the sample size allocation weights for the two groups 

Enables fractional input and output for sample sizes 

Specifies the common sample size per group 

Specifies the sample size 

Specify power 

Specifies the desired power of the test 

Specify computational options 

Specifies the number of categories for each variable 

Control ordering in output 

Controls the output order of parameters 
Table 75.26 summarizes the valid result parameters in the TWOSAMPLEWILCOXON statement.
Table 75.26: Summary of Result Parameters in the TWOSAMPLEWILCOXON Statement
Analyses 
Solve For 
Syntax 

TEST=WMW 
Power 

Sample size 

To specify the sample size and allocation, choose one of the following parameterizations:
sample size per group in a balanced design (using the NPERGROUP= option)
total sample size and allocation weights (using the NTOTAL= and GROUPWEIGHTS= options)
individual group sample sizes (using the GROUPNS= option)
This section summarizes the syntax for the common analyses supported in the TWOSAMPLEWILCOXON statement.
The following statements performs a power analysis for WilcoxonMannWhitney tests comparing an ordinal variable with each other type of distribution. Default values for the ALPHA=, NBINS=, SIDES=, and TEST= options specify a twosided test with a significance level of 0.05 and the use of 1000 categories per distribution when discretization is needed.
proc power; twosamplewilcoxon vardist("myordinal") = ordinal ((0 1 2) : (.2 .3 .5)) vardist("mybeta1") = beta (1, 2) vardist("mybeta2") = beta (1, 2, 0, 2) vardist("mybinomial") = binomial (.3, 3) vardist("myexponential") = exponential (2) vardist("mygamma") = gamma (1.5, 2) vardist("mylaplace") = laplace (1, 2) vardist("mylogistic") = logistic (1, 2) vardist("mylognormal") = lognormal (1, 2) vardist("mynormal") = normal (3, 2) vardist("mypoisson") = poisson (2) vardist("myuniform") = uniform (0, 2) variables = "myordinal"  "mybeta1" "mybeta2" "mybinomial" "myexponential" "mygamma" "mylaplace" "mylogistic" "mylognormal" "mynormal" "mypoisson" "myuniform" ntotal = 40 power = .; run;