BookmarkSubscribeRSS Feed
Kastchei
Pyrite | Level 9
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.
2 REPLIES 2
deleted_user
Not applicable
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
LarsDiaz
Calcite | Level 5

The HTML seems to have wreaked a little bit of havoc on an otherwise very illuminating and much appreciated answer 🙂 thanks

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2418 views
  • 1 like
  • 3 in conversation