<?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: How do I use the CONTRAST statement in PROC LOGISTIC to get an odds ratio? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111351#M9511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=WORK.EDUC ORDER=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FREQ COUNT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CLASS EDUCATION_LEVEL (ref='LESS') REGION (ref='WEST') / param=reference order=FORMATTED;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MODEL AGREEMENT = EDUCATION_LEVEL REGION EDUCATION_LEVEL*REGION / link=clogit &lt;/P&gt;&lt;P&gt;&amp;nbsp; SCALE=NONE AGGREGATE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FORMAT EDUCATION_LEVEL EDUCATION_LEVEL. REGION REGION.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LSMEANS EDUCATION_LEVEL*REGION/E;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;RUN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should give the means on the cumulative logit scale, and the /e option will give the coefficients, in order, for each of these means.&amp;nbsp; You could then consolidate them as you want to get the comparisons.&amp;nbsp; An example might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LSMESTIMATE education_level*region 'college vs less, averaged over regions' &amp;lt;INSERT APPROPRIATE VALUES HERE&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the appropriate values would look something like 1 0 -1 1 0 -1 1 0 -1 (divisor=3)/exp.&amp;nbsp; I put this in a separate place, because I am not sure how everything will sort without running code.&amp;nbsp; It just looks like there are nine estimated values, and this would average over regions.&amp;nbsp; Order is critical however, which is why I added the /e option to the lsmeans statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Oct 2012 13:42:41 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2012-10-30T13:42:41Z</dc:date>
    <item>
      <title>How do I use the CONTRAST statement in PROC LOGISTIC to get an odds ratio?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111348#M9508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have data containing counts across the following three variables.&amp;nbsp; Possible values are noted below (3 potential values each).&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;EDUCATION_LEVEL&lt;UL&gt;&lt;LI&gt;"HIGH" - Referring to high school (referent)&lt;/LI&gt;&lt;LI&gt;"LESS" - Referring to less than high school&lt;/LI&gt;&lt;LI&gt;"COLLEGE" - Referring to college students&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;REGION&lt;UL&gt;&lt;LI&gt;WEST (referent)&lt;/LI&gt;&lt;LI&gt;MIDWEST&lt;/LI&gt;&lt;LI&gt;EAST&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;AGREEMENT (with a given statement - NOTE THIS IS AN ORDINAL VARIABLE)&lt;UL&gt;&lt;LI&gt;DISAGREE&lt;/LI&gt;&lt;LI&gt;NEUTRAL&lt;/LI&gt;&lt;LI&gt;AGREE&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a logistic regression model to fit this data in order to estimate the odds ratio comparing the "COLLEGE" and "LESS" categories of my EDUCATION_LEVEL variable, adjusting for variation in region.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Honestly any sort of statistical test indicating the difference between these two categories could be useful.&amp;nbsp; I just can't seem to get it to do anything useful for me.&amp;nbsp; I feel like I've been messing with this for way too long and am thinking of scrapping the whole thing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run this code, all I get is odds ratios comparing all the specific permutations of all three variables but I can't figure out how to write a contrast statement to give me a ratio that's pooled across the regions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=WORK.EDUC ORDER=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FREQ COUNT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CLASS EDUCATION_LEVEL (ref='LESS') REGION (ref='WEST') / param=reference order=FORMATTED;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MODEL AGREEMENT = EDUCATION_LEVEL REGION EDUCATION_LEVEL*REGION / link=clogit &lt;/P&gt;&lt;P&gt;&amp;nbsp; SCALE=NONE AGGREGATE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FORMAT EDUCATION_LEVEL EDUCATION_LEVEL. REGION REGION.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ODDSRATIO EDUCATION_LEVEL / CL=BOTH DIFF=REF&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;title "main effects partial proportional odds model" ;&lt;/P&gt;&lt;P&gt;CONTRAST 'COLLEGE vs LESS' EDUCATION_LEVEL 2/ ESTIMATE=exp ;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 08:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111348#M9508</guid>
      <dc:creator>mconover</dc:creator>
      <dc:date>2012-10-30T08:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the CONTRAST statement in PROC LOGISTIC to get an odds ratio?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111349#M9509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are on version 9.22 or STAT12.1, take a look at the LSMESTIMATE statement.&amp;nbsp; By coding up the specifics for your class levels properly, and using the EXP option, you should be able to get the odds ratios you want.&amp;nbsp; Let us know if it works (because I'm kind of spitballing on this).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 11:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111349#M9509</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-10-30T11:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the CONTRAST statement in PROC LOGISTIC to get an odds ratio?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111350#M9510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry couldn't get that to work at all.&amp;nbsp; I don't really know how to use that statement though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 12:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111350#M9510</guid>
      <dc:creator>mconover</dc:creator>
      <dc:date>2012-10-30T12:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the CONTRAST statement in PROC LOGISTIC to get an odds ratio?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111351#M9511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=WORK.EDUC ORDER=data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FREQ COUNT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CLASS EDUCATION_LEVEL (ref='LESS') REGION (ref='WEST') / param=reference order=FORMATTED;&lt;/P&gt;&lt;P&gt;&amp;nbsp; MODEL AGREEMENT = EDUCATION_LEVEL REGION EDUCATION_LEVEL*REGION / link=clogit &lt;/P&gt;&lt;P&gt;&amp;nbsp; SCALE=NONE AGGREGATE ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; FORMAT EDUCATION_LEVEL EDUCATION_LEVEL. REGION REGION.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LSMEANS EDUCATION_LEVEL*REGION/E;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;RUN:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should give the means on the cumulative logit scale, and the /e option will give the coefficients, in order, for each of these means.&amp;nbsp; You could then consolidate them as you want to get the comparisons.&amp;nbsp; An example might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LSMESTIMATE education_level*region 'college vs less, averaged over regions' &amp;lt;INSERT APPROPRIATE VALUES HERE&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the appropriate values would look something like 1 0 -1 1 0 -1 1 0 -1 (divisor=3)/exp.&amp;nbsp; I put this in a separate place, because I am not sure how everything will sort without running code.&amp;nbsp; It just looks like there are nine estimated values, and this would average over regions.&amp;nbsp; Order is critical however, which is why I added the /e option to the lsmeans statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2012 13:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-do-I-use-the-CONTRAST-statement-in-PROC-LOGISTIC-to-get-an/m-p/111351#M9511</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2012-10-30T13:42:41Z</dc:date>
    </item>
  </channel>
</rss>

