<?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 median and mean tests for several classes in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307263#M16262</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ususally when doing a median test I use the proc npar1way - I have a certain data variable with divised into 2 classes and i d the test to compare the medians for each class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I have more than 2 classes, say 3, then I have to make proc npar1way 3 times because I have 3 pairs. Is it possible for SAS to do all the different pairwise median tests within the same procedure (like this don't have to repeat the same procedure 3 times)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same question applies for the mean test proc ttest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Oct 2016 23:13:37 GMT</pubDate>
    <dc:creator>ilikesas</dc:creator>
    <dc:date>2016-10-25T23:13:37Z</dc:date>
    <item>
      <title>median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307263#M16262</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ususally when doing a median test I use the proc npar1way - I have a certain data variable with divised into 2 classes and i d the test to compare the medians for each class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But when I have more than 2 classes, say 3, then I have to make proc npar1way 3 times because I have 3 pairs. Is it possible for SAS to do all the different pairwise median tests within the same procedure (like this don't have to repeat the same procedure 3 times)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Same question applies for the mean test proc ttest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2016 23:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307263#M16262</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-25T23:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307277#M16263</link>
      <description>&lt;P&gt;This is called pairwise comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do it in certain procs and not others. PROC GLM/ANOVA will allow pairwise comparison, unfortunately NPAR1WAY doesn't have pairwise AFAIK.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 01:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307277#M16263</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T01:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307281#M16264</link>
      <description>&lt;P&gt;And google proves me wrong...&lt;/P&gt;
&lt;P&gt;look at the DSCF on the PROC NPAR1WAY statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_syntax01.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_syntax01.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 01:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307281#M16264</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T01:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307304#M16266</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the DSCF and it worked, but the results that I get with DSCF are somewhat different than when I am doing an individual pair median comparison. Is it normal?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test3;
set test;
if group =1 or group =3;
run;

/*for the individual pair wilcoxon test*/
ods graphics off;
ods output wilcoxontest=a_3;
proc npar1way data=test3 wilcoxon median ;
var data;
class group;
run;


/*using DSCF*/
proc npar1way data=test dscf ;
var data;
class group;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 03:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307304#M16266</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-26T03:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307306#M16267</link>
      <description>&lt;P&gt;define different. I can't see your data or output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 04:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307306#M16267</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T04:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307308#M16268</link>
      <description>&lt;P&gt;here is my original data "test":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data test;
input data group;
datalines;
1	1
2	1
3	1
4	1
5	1
6	1
7	1
8	1
9	1
10	1
11	1
12	1
13	2
14	2
15	2
16	2
17	2
18	2
19	2
20	2
21	2
22	2
23	2
24	3
25	3
26	3
27	3
28	3
29	3
30	3
31	3
;
run;&lt;/PRE&gt;
&lt;P&gt;when I do the dscf option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*using DSCF*/
ods graphics off;
ods output dscf=b;
proc npar1way data=test dscf ;
var data;
class group;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get a Wilcoxon Z = -3.7033 for group 1 vs group 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whereas when I do a regular median test using group 1 and group 3:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test1_3;
set test;
if group =1 or group =3;
run;

/*for the individual pair wilcoxon test*/
ods graphics off;
ods output wilcoxontest=a_3;
proc npar1way data=test1_3 wilcoxon median ;
var data;
class group;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I get a Wilcoxon Z = 3.6647&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 04:26:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307308#M16268</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-26T04:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307309#M16269</link>
      <description>&lt;P&gt;Read the docs&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_details22.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_details22.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 04:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307309#M16269</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T04:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307314#M16270</link>
      <description>&lt;P&gt;ok I think I understand, its becasue the DSCF method deosn't include a continuity correction in&amp;nbsp;the Wilcoxon test statistic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And in fact, when I did a regular 2 sample npar1way median test and included the "correction = no" option, I got the same Wilcoxon Z as with the DSCF method.&lt;/P&gt;
&lt;P&gt;Is it possible to include the continuity correction when doing the DSCF method? If no, I guess this will answer the first part of my question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the second part, is it possible to compare the means of several samples in one step? When I used proc ttest and included more than 2 classes I got an error message that there are more than 2 levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 05:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307314#M16270</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-26T05:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307317#M16271</link>
      <description>&lt;P&gt;Ttests are between two samples. ANOVA is for more than 2 samples.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It probably has a multiple comparison option if you check the docs.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 05:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307317#M16271</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T05:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: median and mean tests for several classes</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307830#M16288</link>
      <description>&lt;P&gt;Thanks Reeza for the guidance. I will summarize here the discussion and put it as the solution like this its clear to future readers:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Median test: it is done with proc npar1way for 2 samples. Can do pairwise median comparison for more than 2 samples if add the DSCF option. But note that the &lt;SPAN&gt;DSCF method deosn't include a continuity correction in&amp;nbsp;the Wilcoxon test statistic, while "normal" &amp;nbsp;proc npar1way for 2 samples by dfault does (although you can include the "correction=no" option so it doesn't.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_details22.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_npar1way_details22.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Mean test: for 2 samples it is done with proc ttest. Can do pairwise mean comparison for more than 2 samples with proc GLM and ANOVA, but should read the docs for the details:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/428.html" target="_self"&gt;http://support.sas.com/kb/45/428.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_anova_sect027.htm" target="_self"&gt;https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_anova_sect027.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Oct 2016 03:42:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/median-and-mean-tests-for-several-classes/m-p/307830#M16288</guid>
      <dc:creator>ilikesas</dc:creator>
      <dc:date>2016-10-28T03:42:01Z</dc:date>
    </item>
  </channel>
</rss>

