<?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: Understanding the SAS conception of CMH test in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435681#M22995</link>
    <description>&lt;P&gt;That documentation reference is about twenty years old.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the latest version which aligns fairly well with what you're stating:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_freq_details90.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_freq_details90.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you're using SAS 8 for some reason?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2018 16:05:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-09T16:05:30Z</dc:date>
    <item>
      <title>Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435650#M22987</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been asked to compute a Cochran-Mantel-Haenszel (CMH) Test on 2 variables. Both variables are usual values (columns) for a high number of observations (lines).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the little&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://en.wikipedia.org/wiki/Cochran%E2%80%93Mantel%E2%80%93Haenszel_statistics" rel="nofollow noreferrer" target="_blank"&gt;Wikipedia page&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://www.biostathandbook.com/cmh.html" rel="nofollow noreferrer" target="_blank"&gt;Biostat Handbook&lt;/A&gt;, I tried to understand what the CMH test is and here is what I understood :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Cochran–Mantel–Haenszel test for&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;repeated tests of independence&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;: Use the Cochran–Mantel–Haenszel test when you have data from 2×2 tables that you've repeated at different times or locations.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Then it seems it should be done over 3 factors : lines, cols and stratas :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;There are three nominal variables: the two variables of the 2×2 test of independence, and the third nominal variable that identifies the repeats.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Indeed, in R, the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;mantelhaen.test{stats}&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;function needs 3 factors or a 3 dimensions array which makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, in SAS, you can easily write a 2 factors CMH test :&lt;/P&gt;&lt;PRE class="default prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;PROC FREQ data&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;MY_DATA&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    TABLE VAR1 &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;*&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; VAR2 &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;CMH&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt; &lt;SPAN class="com"&gt;/*or /CHISQ, which give the first MH pvalue too*/&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;    RUN&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The SAS documentation is not crystal clear about it, and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://support.sas.com/kb/32/711.html" rel="nofollow noreferrer" target="_blank"&gt;examples&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;are maid over 3 factors, but this 2 dimensions test runs normally and give you 3 statistics and p-values, including a "correlation" one. All stats and pvalues are different from a standard chisquare test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://v8doc.sas.com/sashtml/stat/chap28/sect19.htm" rel="nofollow noreferrer" target="_blank"&gt;This SAS doc&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;link gives another definition of the CMH (sorry no anchor, search for "Mantel-Haenszel"), which is not what I understood from wikipedia. It states that :&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;The Mantel-Haenszel chi-square statistic tests the alternative hypothesis that there is a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;linear association&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;between the row variable and the column variable. Both variables must lie on an ordinal scale.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But actually, I can run a proc freq with CMH option on 2 character variables with no error. Is it normal ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to compute the CMH test with both R and SAS but I want to know what I am doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the difference between SAS and common conception of the CMH test ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 14:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435650#M22987</guid>
      <dc:creator>DanCh</dc:creator>
      <dc:date>2018-02-09T14:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435657#M22989</link>
      <description>&lt;P&gt;The CMH tests provided by PROC FREQ are the same as the CMH tests defined in the statistical literature. The CMH tests generally test for association within a set of tables, where each table represents a stratum.&amp;nbsp; However, there is no requirement that there is more than one stratum, so it can just as well be used with a single table. In the case of a single table, the CMH correlation test is the same as the Mantel-Haenszel test which is provided by the CHISQ option. The three CMH tests allow for the row and column variables defining each table to have nominal or ordinal scale so that an appropriate hypothesis can be tested. See &lt;A href="http://support.sas.com/kb/40133" target="_self"&gt;this note&lt;/A&gt; for more on that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 14:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435657#M22989</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2018-02-09T14:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435677#M22993</link>
      <description>Your note was very interesting, but still the SAS doc talks about linear association, which doesn't make a lot of sense to me with unordered categorical variable. Could you explain a little more please ?</description>
      <pubDate>Fri, 09 Feb 2018 15:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435677#M22993</guid>
      <dc:creator>DanCh</dc:creator>
      <dc:date>2018-02-09T15:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435678#M22994</link>
      <description>&lt;P&gt;As shown in the note I referred you to, the row and column variables in each stratum table can be ordinal (ordered levels) or nominal (unordered). If both the row and column variables have multiple possible values, and are ordered (such as low, medium, high), then you might be particularly interested to test whether the column variable increases as the row variable increases. The correlation CMH statistic tests this linear association hypothesis. Obviously, the linear association hypothesis is not of interest if both variables are unordered. In that case you would use the third CMH statistic - the general association statistic.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 15:57:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435678#M22994</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2018-02-09T15:57:03Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435681#M22995</link>
      <description>&lt;P&gt;That documentation reference is about twenty years old.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See the latest version which aligns fairly well with what you're stating:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_freq_details90.htm&amp;amp;locale=en" target="_blank"&gt;http://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.2&amp;amp;docsetId=procstat&amp;amp;docsetTarget=procstat_freq_details90.htm&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you're using SAS 8 for some reason?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435681#M22995</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T16:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435684#M22996</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/192436"&gt;@DanCh&lt;/a&gt; wrote:&lt;BR /&gt;Your note was very interesting, but still the SAS doc talks about linear association, which doesn't make a lot of sense to me with unordered categorical variable. Could you explain a little more please ?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;and the SAS 9.4 Documentation.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The alternative hypothesis for the correlation statistic is that there is a linear association between&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="aa-varname"&gt;X&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="aa-varname"&gt;Y&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;in at least one stratum. &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;If either&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;CODE class="aa-varname"&gt;X&lt;/CODE&gt;&amp;nbsp;or&amp;nbsp;&lt;CODE class="aa-varname"&gt;Y&lt;/CODE&gt;&amp;nbsp;does not lie on an ordinal (or interval) scale, this statistic is not meaningful.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 16:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/435684#M22996</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-09T16:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/436624#M23049</link>
      <description>Ok I didn't see the version was different (curious though that the test changed over versions). I think I get it now, thank to you two.</description>
      <pubDate>Tue, 13 Feb 2018 10:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/436624#M23049</guid>
      <dc:creator>DanCh</dc:creator>
      <dc:date>2018-02-13T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding the SAS conception of CMH test</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/436757#M23051</link>
      <description>&lt;P&gt;I don't think the test changed, I think the documentation did.&lt;/P&gt;
&lt;P&gt;And SAS 8 was initially released in 1999.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Feb 2018 15:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Understanding-the-SAS-conception-of-CMH-test/m-p/436757#M23051</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-13T15:44:55Z</dc:date>
    </item>
  </channel>
</rss>

