<?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: Estimates/Odds Ratio for 2-way interaction of binary (0,1) predictors in Proc Logistic. in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/650222#M31219</link>
    <description>&lt;P&gt;You don't need any of the ODDSRATIO or CONTRASTS statements. You can get all possible pairwise comparisons of the four C*D levels using a single LSMEANS statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LOGISTIC DATA=work.data1;
  CLASS  a (REF='0') b (REF='0') c d / PARAM=glm ;
  MODEL  y(event="1") = a b c d c*d;
  lsmeans c*d / ilink cl diff oddsratio;
  run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 24 May 2020 22:29:59 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2020-05-24T22:29:59Z</dc:date>
    <item>
      <title>Estimates/Odds Ratio for 2-way interaction of binary (0,1) predictors in Proc Logistic.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/649952#M31190</link>
      <description>&lt;P&gt;I have a significant interaction that I want to explore further. I'm not the best with contrast coding and most of the examples I'm finding are either 3-way interactions or those with all class variables or a combo class/continuous. Here are the basics of my model:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS RTF;
ODS GRAPHICS ON;
PROC LOGISTIC DATA=work.data1 DESCENDING SIMPLE PLOTS=ALL;
  CLASS  a (REF='0') b (REF='0') / PARAM=reference ;
  MODEL  y = a b c d c*d / EXPB CL INFLUENCE ;
  ODDSRATIO c / AT(d = 0 1) CL=WALD;
  ODDSRATIO d / AT(c = 0 1) CL=WALD;
  CONTRAST 'c=1 &amp;amp; d=0' c 1 d 0 /ESTIMATE = PARM E;
  CONTRAST 'c=1 &amp;amp; d=1' c 1 d 1 /ESTIMATE = PARM E;
  CONTRAST 'c=0 &amp;amp; d=0' c 0 d 0 /ESTIMATE = PARM E;
  CONTRAST 'c=0 &amp;amp; d=1' c 0 d 1 /ESTIMATE = PARM E;
  UNITS / DEFAULT=1;
  OUTPUT OUT=Results;
RUN;
ODS GRAPHICS OFF;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For this model, y is binary (0,1), a and b and both categorical with numerous levels, and c and d are continuous binary (0,1) variables. What I want is to get estimates/odds ratios for all levels of the interaction, which is p&amp;lt;.01. I don't think this code is correct, but I have a feeling I'm close. Any advice would be appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 17:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/649952#M31190</guid>
      <dc:creator>NMB82</dc:creator>
      <dc:date>2020-05-22T17:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates/Odds Ratio for 2-way interaction of binary (0,1) predictors in Proc Logistic.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/650217#M31218</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/322145"&gt;@NMB82&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your ODDSRATIO statements are correct. Option "CL=WALD" is the default, though, hence redundant. Also redundant are the UNITS statement (unit 1 is the default) and three of the CONTRAST statements: The third is trivial, the first and the fourth repeat the results for the parameters of &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the ODDSRATIO statements you already get the odds ratios (and pertinent confidence limits) for (&lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt;,&lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt;)= (1, 0) vs. (0, 0),&amp;nbsp;(1, 1) vs. (0, 1),&amp;nbsp;(0, 1) vs. (0, 0) and&amp;nbsp;(1, 1) vs. (1, 0), all adjusted for &lt;FONT face="courier new,courier"&gt;a&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;b&lt;/FONT&gt;.&amp;nbsp;The second CONTRAST statement suggests that you're also interested in the odds ratio&amp;nbsp;"(1, 1) vs. (0, 0)", but for this you would need to use the ESTIMATE=EXP option and to insert the interaction term &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;c*d 1&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;into the list of effects and values. You can get &lt;EM&gt;both&lt;/EM&gt; the estimate (here: of the sum of the estimates for &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;c&lt;/FONT&gt;*&lt;FONT face="courier new,courier"&gt;d&lt;/FONT&gt;) and the odds ratio (i.e. the exponentiated estimate) with a similar &lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_logistic_syntax14.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en" target="_blank" rel="noopener"&gt;ESTIMATE statement&lt;/A&gt;. Here's an ESTIMATE statement that in addition (just for completeness and as another example) includes the remaining odds ratio "(1, 0) vs. (0, 1)":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;estimate 'c=1, d=0 vs. c=0, d=1' c 1 d -1,
         'c=1, d=1 vs. c=0, d=0' c 1 d 1 c*d 1 / e cl exp;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 May 2020 20:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/650217#M31218</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-05-24T20:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Estimates/Odds Ratio for 2-way interaction of binary (0,1) predictors in Proc Logistic.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/650222#M31219</link>
      <description>&lt;P&gt;You don't need any of the ODDSRATIO or CONTRASTS statements. You can get all possible pairwise comparisons of the four C*D levels using a single LSMEANS statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC LOGISTIC DATA=work.data1;
  CLASS  a (REF='0') b (REF='0') c d / PARAM=glm ;
  MODEL  y(event="1") = a b c d c*d;
  lsmeans c*d / ilink cl diff oddsratio;
  run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 May 2020 22:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Estimates-Odds-Ratio-for-2-way-interaction-of-binary-0-1/m-p/650222#M31219</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2020-05-24T22:29:59Z</dc:date>
    </item>
  </channel>
</rss>

