<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Mann-Whitney U Statistic in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64795#M18429</link>
    <description>I guess it's not a direct output of NPAIR1WAY. Manual calculation is desired. For example,&lt;BR /&gt;
/*&lt;BR /&gt;
data wilcox;&lt;BR /&gt;
infile datalines missover;&lt;BR /&gt;
input type $ x @;&lt;BR /&gt;
do while (x ne .);&lt;BR /&gt;
	output;&lt;BR /&gt;
	input x @;&lt;BR /&gt;
end;&lt;BR /&gt;
input;&lt;BR /&gt;
datalines;&lt;BR /&gt;
sunlight 6.0 4.8 5.1 5.5 4.1 5.3 4.5 5.1  &lt;BR /&gt;
shade 6.5 5.5 6.3 7.2 6.8 5.5 5.9 5.5&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
ods output WilcoxonScores=yyy;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
&lt;BR /&gt;
proc npar1way wilcoxon data=wilcox;&lt;BR /&gt;
	class type;&lt;BR /&gt;
	var x;&lt;BR /&gt;
	exact;&lt;BR /&gt;
run;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	array n[2] _temporary_;&lt;BR /&gt;
	array R[2] _temporary_;&lt;BR /&gt;
	array U[2] _temporary_;&lt;BR /&gt;
	do _n_=1 by 1 until(eof);&lt;BR /&gt;
		set yyy(rename=(N=_N)) end=eof;&lt;BR /&gt;
		n[_n_] = _n;&lt;BR /&gt;
		R[_n_] = SumOfScores;&lt;BR /&gt;
	end;	&lt;BR /&gt;
	U[1] = n[1]*n[2] + n[1]*(n[1]+1)/2 - R[1];&lt;BR /&gt;
	U[2] = n[1]*n[2] + n[2]*(n[2]+1)/2 - R[2];&lt;BR /&gt;
	put U[1]= U[2]=;&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
of course you can do it in IML.&lt;BR /&gt;
&lt;BR /&gt;
Reference:&lt;BR /&gt;
&lt;A href="http://en.wikipedia.org/wiki/Mann-Whitney_U" target="_blank"&gt;http://en.wikipedia.org/wiki/Mann-Whitney_U&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.saburchill.com/IBbiology/stats/002.html" target="_blank"&gt;http://www.saburchill.com/IBbiology/stats/002.html&lt;/A&gt;</description>
    <pubDate>Fri, 05 Dec 2008 23:16:49 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2008-12-05T23:16:49Z</dc:date>
    <item>
      <title>Mann-Whitney U Statistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64794#M18428</link>
      <description>All:&lt;BR /&gt;
&lt;BR /&gt;
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?&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
Thank you.</description>
      <pubDate>Fri, 05 Dec 2008 18:25:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64794#M18428</guid>
      <dc:creator>Kastchei</dc:creator>
      <dc:date>2008-12-05T18:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Mann-Whitney U Statistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64795#M18429</link>
      <description>I guess it's not a direct output of NPAIR1WAY. Manual calculation is desired. For example,&lt;BR /&gt;
/*&lt;BR /&gt;
data wilcox;&lt;BR /&gt;
infile datalines missover;&lt;BR /&gt;
input type $ x @;&lt;BR /&gt;
do while (x ne .);&lt;BR /&gt;
	output;&lt;BR /&gt;
	input x @;&lt;BR /&gt;
end;&lt;BR /&gt;
input;&lt;BR /&gt;
datalines;&lt;BR /&gt;
sunlight 6.0 4.8 5.1 5.5 4.1 5.3 4.5 5.1  &lt;BR /&gt;
shade 6.5 5.5 6.3 7.2 6.8 5.5 5.9 5.5&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
ods output WilcoxonScores=yyy;&lt;BR /&gt;
ods listing close;&lt;BR /&gt;
&lt;BR /&gt;
proc npar1way wilcoxon data=wilcox;&lt;BR /&gt;
	class type;&lt;BR /&gt;
	var x;&lt;BR /&gt;
	exact;&lt;BR /&gt;
run;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	array n[2] _temporary_;&lt;BR /&gt;
	array R[2] _temporary_;&lt;BR /&gt;
	array U[2] _temporary_;&lt;BR /&gt;
	do _n_=1 by 1 until(eof);&lt;BR /&gt;
		set yyy(rename=(N=_N)) end=eof;&lt;BR /&gt;
		n[_n_] = _n;&lt;BR /&gt;
		R[_n_] = SumOfScores;&lt;BR /&gt;
	end;	&lt;BR /&gt;
	U[1] = n[1]*n[2] + n[1]*(n[1]+1)/2 - R[1];&lt;BR /&gt;
	U[2] = n[1]*n[2] + n[2]*(n[2]+1)/2 - R[2];&lt;BR /&gt;
	put U[1]= U[2]=;&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
of course you can do it in IML.&lt;BR /&gt;
&lt;BR /&gt;
Reference:&lt;BR /&gt;
&lt;A href="http://en.wikipedia.org/wiki/Mann-Whitney_U" target="_blank"&gt;http://en.wikipedia.org/wiki/Mann-Whitney_U&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://www.saburchill.com/IBbiology/stats/002.html" target="_blank"&gt;http://www.saburchill.com/IBbiology/stats/002.html&lt;/A&gt;</description>
      <pubDate>Fri, 05 Dec 2008 23:16:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64795#M18429</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2008-12-05T23:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Mann-Whitney U Statistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64796#M18430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The HTML seems to have wreaked a little bit of havoc on an otherwise very illuminating and much appreciated answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 13:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Mann-Whitney-U-Statistic/m-p/64796#M18430</guid>
      <dc:creator>LarsDiaz</dc:creator>
      <dc:date>2014-02-19T13:42:01Z</dc:date>
    </item>
  </channel>
</rss>

