<?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 twosample Wilcoxon-Mann Whitney methods in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358006#M64307</link>
    <description>&lt;P&gt;This is one of those, "I knew how to do it in the other program, but how to in SAS" questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to do a Wilcoxon Mann-Whitney test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data comes as;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;SUBJ&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TIME&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TEST&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;01&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;01&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.5&lt;/P&gt;&lt;/TD&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TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then I write my wilcoxon to compare TEST_1 to TEST_2, which is sort of like (TEST_2 - TEST_1=DIFF).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But SAS seems to want to use the first data structure. &amp;nbsp;It wants me to use a VARIABLE and a CLASS, (with only 2 values in the CLASS column.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write the procedure so I can ensure that the order of operations is going the right way, as in, that I'm subtracting TEST_1 from TEST_2 and not the other way around?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the documentation from the NPAR1WAY&amp;nbsp;to get some results, but I don't feel that I'm getting the same info I'm used to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample of my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;BR /&gt;proc npar1way data=my.data&lt;BR /&gt;&lt;BR /&gt;plots=all;&lt;BR /&gt;where time=1 or time=2;&lt;BR /&gt;var test;&lt;BR /&gt;class time;&lt;BR /&gt;run;&lt;BR /&gt;ods graphics off;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am comparing TIME1 against TIME2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess my question is partly statistical. &amp;nbsp;Does the p-value consider the result as an absolute result, not caring if the difference was positive or negative? &amp;nbsp;The Null Hypothese says they are equal, so whether the difference is good or bad, doesn't really show in the p-value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2017 18:14:40 GMT</pubDate>
    <dc:creator>Jbhammon</dc:creator>
    <dc:date>2017-05-11T18:14:40Z</dc:date>
    <item>
      <title>twosample Wilcoxon-Mann Whitney methods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358006#M64307</link>
      <description>&lt;P&gt;This is one of those, "I knew how to do it in the other program, but how to in SAS" questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to do a Wilcoxon Mann-Whitney test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data comes as;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;SUBJ&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TIME&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TEST&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;01&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;01&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;02&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2.4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;02&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the pasT, I would explain transpose a wide format, like this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;SUBJ&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TEST_1&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;STRONG&gt;TEST_2&lt;/STRONG&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;01&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;02&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2.4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;3.5&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Then I write my wilcoxon to compare TEST_1 to TEST_2, which is sort of like (TEST_2 - TEST_1=DIFF).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But SAS seems to want to use the first data structure. &amp;nbsp;It wants me to use a VARIABLE and a CLASS, (with only 2 values in the CLASS column.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I write the procedure so I can ensure that the order of operations is going the right way, as in, that I'm subtracting TEST_1 from TEST_2 and not the other way around?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the documentation from the NPAR1WAY&amp;nbsp;to get some results, but I don't feel that I'm getting the same info I'm used to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a sample of my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;BR /&gt;proc npar1way data=my.data&lt;BR /&gt;&lt;BR /&gt;plots=all;&lt;BR /&gt;where time=1 or time=2;&lt;BR /&gt;var test;&lt;BR /&gt;class time;&lt;BR /&gt;run;&lt;BR /&gt;ods graphics off;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am comparing TIME1 against TIME2.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess my question is partly statistical. &amp;nbsp;Does the p-value consider the result as an absolute result, not caring if the difference was positive or negative? &amp;nbsp;The Null Hypothese says they are equal, so whether the difference is good or bad, doesn't really show in the p-value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 18:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358006#M64307</guid>
      <dc:creator>Jbhammon</dc:creator>
      <dc:date>2017-05-11T18:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: twosample Wilcoxon-Mann Whitney methods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358018#M64308</link>
      <description>&lt;P&gt;Good questions. I am not an expert in this area, but I &lt;STRONG&gt;think&lt;/STRONG&gt; the answers are:&lt;/P&gt;
&lt;P&gt;1.If you want to use the wide data, you can use PROC FREQ:&lt;/P&gt;
&lt;P&gt;proc freq data=my.data;&lt;/P&gt;
&lt;P&gt;tables test_1*test_2 / cmh2&amp;nbsp;chisq scores=rank;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;However, NPAR1WAY does a continuity correction by default, whereas PROC FREQ does not, so the answers are slightly different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Yes, you need to use long data for NPR1WAY. I think the answer is that it&amp;nbsp;doesn't matter which sample is "Sample 1" and which is "Sample 2". There is a statement as such in &lt;A href="https://en.wikipedia.org/wiki/Mann%E2%80%93Whitney_U_test" target="_self"&gt;the Wikipedia article.&lt;/A&gt;&amp;nbsp;The SAS doc tells you that SAS uses the size of the groups to determine which is "Sample 1" and which is "Sample 2": The doc says "&lt;SPAN&gt;To compute the linear rank statistic &lt;/SPAN&gt;&lt;SPAN class=" AAmathtext"&gt;S&lt;/SPAN&gt;&lt;SPAN&gt;, PROC NPAR1WAY sums the scores of the observations in the smaller of the two samples. If both samples have the same number of observations, PROC NPAR1WAY sums those scores for the sample that appears first in the input data set."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 18:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358018#M64308</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-05-11T18:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: twosample Wilcoxon-Mann Whitney methods</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358028#M64309</link>
      <description>&lt;P&gt;Thanks, this was helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From your reply and other research, I think I understand it better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 19:43:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/twosample-Wilcoxon-Mann-Whitney-methods/m-p/358028#M64309</guid>
      <dc:creator>Jbhammon</dc:creator>
      <dc:date>2017-05-11T19:43:43Z</dc:date>
    </item>
  </channel>
</rss>

