<?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: PROC FREQ CMH test Ordinal variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/701887#M25836</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358674"&gt;@SaloméT&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ assigns numeric scores to the levels of the row and column variables (i.e., &lt;FONT face="courier new,courier"&gt;trt&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; in your case) which are used in the calculation of the first two CMH statistics. As you don't specify the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;locale=en#statug.freq.freqscoresopt" target="_blank" rel="noopener"&gt;SCORES= option&lt;/A&gt; of the TABLES statement, the default scoring method (SCORES=TABLE) is used. These scores equal the variable values for numeric variables and the row/column numbers (starting from 0, although the documentation states 1, but the results are the same) for character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, as long as all levels 1 through 7 of &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; exist in the data (and the ORDER= option implies the order 1, 2, ..., 7), it doesn't matter if that variable is numeric or character because either way the scores are essentially the same. However, if categories 5 and 6 are missing (everything else being the same), the scores for a character variable &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; would be 0, 1, 2, 3, &lt;STRONG&gt;4&lt;/STRONG&gt;, which is not equivalent to 0, 1, 2, 3, &lt;STRONG&gt;6&lt;/STRONG&gt; (or 1, 2, 3, 4, &lt;STRONG&gt;7&lt;/STRONG&gt; for that matter). The difference between levels 4 (mild to moderate) and 7 (severe) would appear smaller (than it likely should be) in the first case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the numeric values 1, 2, ..., 7 (i.e. equal "distances" between adjacent levels) are deemed appropriate to reflect the seven modalities, then you should use the numeric version of &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt;. Thus the difference between levels 4 and 7 will be handled in the same way, whether observations with levels 5 and 6 occur in the data or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;locale=en#statug.freq.freqscorout" target="_blank" rel="noopener"&gt;SCOROUT option&lt;/A&gt; to the TABLES statement to make the scores visible in the output.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2020 20:17:41 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2020-11-26T20:17:41Z</dc:date>
    <item>
      <title>PROC FREQ CMH test Ordinal variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/701847#M25824</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to apply a CMH test to compare Aortic regurgitation (AR) between two groups. Aortic regurgitation is an ordinal variable (tvrn) with 7 modalities (1-None, 2-Trace, 3-Mild, 4-Mild to moderate, 5-Moderate, 6-Moderate to severe, 7-Severe). I observe different p-values for CMH Row Mean Scores Differ test if the ordinal variable is defined as a character variable or as a numeric variable when there is no patient in one of the intermediate level. I would understand the reasons of such difference and be sure to use the correct format this ordinal variable. Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sort data=essai2 ; by tvrn trt; run;
proc freq data=essai2 order=data;
tables trt*tvrn /cmh ;
run;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Example: No patient with&amp;nbsp;5-Moderate or 6-Moderate to severe AR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Results when the ordinal variable is in character.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Character.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52025i5DD984334F51798D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Character.PNG" alt="Character.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Results when the ordinal variable is in numeric:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Numeric.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52026i6F29FCFC2A272FD9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Numeric.PNG" alt="Numeric.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 16:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/701847#M25824</guid>
      <dc:creator>SaloméT</dc:creator>
      <dc:date>2020-11-26T16:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ CMH test Ordinal variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/701887#M25836</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/358674"&gt;@SaloméT&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ assigns numeric scores to the levels of the row and column variables (i.e., &lt;FONT face="courier new,courier"&gt;trt&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; in your case) which are used in the calculation of the first two CMH statistics. As you don't specify the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;locale=en#statug.freq.freqscoresopt" target="_blank" rel="noopener"&gt;SCORES= option&lt;/A&gt; of the TABLES statement, the default scoring method (SCORES=TABLE) is used. These scores equal the variable values for numeric variables and the row/column numbers (starting from 0, although the documentation states 1, but the results are the same) for character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, as long as all levels 1 through 7 of &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; exist in the data (and the ORDER= option implies the order 1, 2, ..., 7), it doesn't matter if that variable is numeric or character because either way the scores are essentially the same. However, if categories 5 and 6 are missing (everything else being the same), the scores for a character variable &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt; would be 0, 1, 2, 3, &lt;STRONG&gt;4&lt;/STRONG&gt;, which is not equivalent to 0, 1, 2, 3, &lt;STRONG&gt;6&lt;/STRONG&gt; (or 1, 2, 3, 4, &lt;STRONG&gt;7&lt;/STRONG&gt; for that matter). The difference between levels 4 (mild to moderate) and 7 (severe) would appear smaller (than it likely should be) in the first case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the numeric values 1, 2, ..., 7 (i.e. equal "distances" between adjacent levels) are deemed appropriate to reflect the seven modalities, then you should use the numeric version of &lt;FONT face="courier new,courier"&gt;tvrn&lt;/FONT&gt;. Thus the difference between levels 4 and 7 will be handled in the same way, whether observations with levels 5 and 6 occur in the data or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=statug&amp;amp;docsetTarget=statug_freq_syntax08.htm&amp;amp;locale=en#statug.freq.freqscorout" target="_blank" rel="noopener"&gt;SCOROUT option&lt;/A&gt; to the TABLES statement to make the scores visible in the output.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 20:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/701887#M25836</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-11-26T20:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ CMH test Ordinal variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/886444#M39320</link>
      <description>&lt;P&gt;Thanks for explanation. How to deal with situation where few categories are missing and we want to calculate CMH2 for ordinal response?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 14:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/886444#M39320</guid>
      <dc:creator>vvvv_ggg</dc:creator>
      <dc:date>2023-07-26T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FREQ CMH test Ordinal variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/886466#M39321</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/446252"&gt;@vvvv_ggg&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The CMH2 option requests the same&amp;nbsp;statistics as the CMH option, except for the "General Association" statistic, which is not included with CMH2. So, what I wrote in response to the original poster of this thread applies to the CMH2 option as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your question addresses a different problem caused by missing categories, please open a new thread in the &lt;A href="https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures" target="_blank" rel="noopener"&gt;Statistical Procedures forum&lt;/A&gt;, which is more appropriate for statistical questions than the "New SAS User" forum. Make sure that you describe the issue in sufficient detail (ideally provide sample data illustrating it).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is also a general recommendation: Even if your issue is similar to one that was discussed weeks (let alone years) ago, it is best practice to &lt;EM&gt;open a new thread&lt;/EM&gt;. This way you reach the maximum possible audience (and hence it is most likely that you get a helpful answer as soon as possible), whereas only a few people would even notice that an addition to an old discussion has been made. Also, only the thread starter can mark a reply as the accepted solution, which helps later readers to find the relevant posting. See&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Getting-Started/How-to-get-fast-helpful-answers/ta-p/226133" target="_blank" rel="noopener"&gt;How to get fast, helpful answers&lt;/A&gt; for this and more tips. Note that you can include a link to an old thread (as I did in the previous sentence; use the "Insert/edit link" button between the smiley and the camera icon) if that helps to explain a similar problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2023 16:04:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/PROC-FREQ-CMH-test-Ordinal-variable/m-p/886466#M39321</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-07-26T16:04:43Z</dc:date>
    </item>
  </channel>
</rss>

