## Mann-Whitney U Statistic

Frequent Contributor
Posts: 82

# Mann-Whitney U Statistic

All:

I need to report the Mann-Whitney U Statistic. Is there a way to get SAS to produce this value via a procedure? If not, is there a way to calculate the U statistic from the Wilcoxon statistics PROC NPAR1WAY provides?

Note: From what I understand, the p-values of the Mann-Whitney and Wilcoxon tests are identical, but I cannot report a Wilcoxon statistic; I must report the U statistic.

Thank you.
Not applicable
Posts: 0

## Re: Mann-Whitney U Statistic

I guess it's not a direct output of NPAIR1WAY. Manual calculation is desired. For example,
/*
data wilcox;
infile datalines missover;
input type \$ x @;
do while (x ne .);
output;
input x @;
end;
input;
datalines;
sunlight 6.0 4.8 5.1 5.5 4.1 5.3 4.5 5.1
shade 6.5 5.5 6.3 7.2 6.8 5.5 5.9 5.5
;
run;
ods output WilcoxonScores=yyy;
ods listing close;

proc npar1way wilcoxon data=wilcox;
class type;
var x;
exact;
run;
data _null_;
array n[2] _temporary_;
array R[2] _temporary_;
array U[2] _temporary_;
do _n_=1 by 1 until(eof);
set yyy(rename=(N=_N)) end=eof;
n[_n_] = _n;
R[_n_] = SumOfScores;
end;
U[1] = n[1]*n[2] + n[1]*(n[1]+1)/2 - R[1];
U[2] = n[1]*n[2] + n[2]*(n[2]+1)/2 - R[2];
put U[1]= U[2]=;
run;
*/
of course you can do it in IML.

Reference:
http://en.wikipedia.org/wiki/Mann-Whitney_U
http://www.saburchill.com/IBbiology/stats/002.html
Not applicable
Posts: 1