<?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: Creating multiple reference groups for a nominal variable in PROC GENMOD in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821941#M34953</link>
    <description>&lt;P&gt;Hi Koen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes, this is what I'm looking for!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, additional questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) Is the "Differences of drug least squares means" table showing the odds of using drug A vs. Drug B?&lt;/P&gt;&lt;P&gt;2) Using your previous example, I added another categorical variable with response options as Yes or No and an interaction term.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data drug;
   input drug$ x r n catvar$ @@;
   datalines;
A  .1   1  10 Yes  A  .23  2  12 No  A  .67  1   9 Yes
B  .2   3  13 Yes  B  .3   4  15 Yes B  .45  5  16 No  B  .78  5  13 Yes
C  .04  0  10 Yes  C  .15  0  11 No  C  .56  1  12 Yes C  .7   2  12 No
D  .34  5  10 Yes  D  .6   5   9 Yes D  .7   8  10 No
E  .2  12  20 Yes  E  .34 15  20 No  E  .56 13  15 No  E  .8  17  20 No
;
run;

proc genmod data=drug;
   class drug catvar;
   model r/n = x drug catvar drug*catvar/ dist = bin link = logit lrci;
 lsmeans drug*catvar / DIFF MEANS ADJUST=BON 
                oddsratio CL EXP ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For this output: I see the interaction effects of using Drug A (vs. Drug E) * Yes (vs. No). Is that correct?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.31.04 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73005iE5A55FD1712E7733/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.31.04 PM.png" alt="Screen Shot 2022-07-06 at 4.31.04 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.25.06 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73006i36EBD6D85A79033A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.25.06 PM.png" alt="Screen Shot 2022-07-06 at 4.25.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the estimates highlighted in purple box do not match. I was wondering why that is. When I compared the values in your previous example (without interaction) the values match. Please see output below.  &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.35.24 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73009iFF0377E30B2A2CC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.35.24 PM.png" alt="Screen Shot 2022-07-06 at 4.35.24 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.35.30 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73010i762EFEE10AC9FBF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.35.30 PM.png" alt="Screen Shot 2022-07-06 at 4.35.30 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Thanks!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2022 21:25:13 GMT</pubDate>
    <dc:creator>varatt90</dc:creator>
    <dc:date>2022-07-06T21:25:13Z</dc:date>
    <item>
      <title>Creating multiple reference groups for a nominal variable in PROC GENMOD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821880#M34951</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have a PROC GENMOD procedure with a nominal predictor variable, can I specify that I want to compare one group with multiple reference groups?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: Let's say I have the predictor variable gender: boy, girl, other.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Right now, I have girl as my reference group. So, in the model, I'll get an LogOR comparing boy vs. girl and other vs. girl.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the same model, am I able to have "boy" as a reference group as well? So I would like to see:&lt;/P&gt;&lt;P&gt;- other vs. girl&lt;/P&gt;&lt;P&gt;- boy vs. girl&amp;nbsp;&lt;/P&gt;&lt;P&gt;- other vs. boy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC GENMOD DATA = Dataset;
CLASS SchoolID Gender (REF = "girl") ;
MODEL Outcome = Age gender / DIST=Binomial LINK=Logit ALPHA=0.05 TYPE3 ;
REPEATED SUBJECT = SCHOOLID / TYPE = EXCH;
RUN;&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 15:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821880#M34951</guid>
      <dc:creator>varatt90</dc:creator>
      <dc:date>2022-07-06T15:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple reference groups for a nominal variable in PROC GENMOD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821905#M34952</link>
      <description>&lt;P&gt;Check if this is giving you what you want :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data drug;
   input drug$ x r n @@;
   datalines;
A  .1   1  10   A  .23  2  12   A  .67  1   9
B  .2   3  13   B  .3   4  15   B  .45  5  16   B  .78  5  13
C  .04  0  10   C  .15  0  11   C  .56  1  12   C  .7   2  12
D  .34  5  10   D  .6   5   9   D  .7   8  10
E  .2  12  20   E  .34 15  20   E  .56 13  15   E  .8  17  20
;
run;

proc genmod data=drug;
   class drug;
   model r/n = x drug / dist = bin
                        link = logit
                        lrci;
 lsmeans drug / DIFF MEANS ADJUST=BON 
                oddsratio CL EXP ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 18:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821905#M34952</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-07-06T18:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple reference groups for a nominal variable in PROC GENMOD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821941#M34953</link>
      <description>&lt;P&gt;Hi Koen,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes, this is what I'm looking for!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also, additional questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1) Is the "Differences of drug least squares means" table showing the odds of using drug A vs. Drug B?&lt;/P&gt;&lt;P&gt;2) Using your previous example, I added another categorical variable with response options as Yes or No and an interaction term.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data drug;
   input drug$ x r n catvar$ @@;
   datalines;
A  .1   1  10 Yes  A  .23  2  12 No  A  .67  1   9 Yes
B  .2   3  13 Yes  B  .3   4  15 Yes B  .45  5  16 No  B  .78  5  13 Yes
C  .04  0  10 Yes  C  .15  0  11 No  C  .56  1  12 Yes C  .7   2  12 No
D  .34  5  10 Yes  D  .6   5   9 Yes D  .7   8  10 No
E  .2  12  20 Yes  E  .34 15  20 No  E  .56 13  15 No  E  .8  17  20 No
;
run;

proc genmod data=drug;
   class drug catvar;
   model r/n = x drug catvar drug*catvar/ dist = bin link = logit lrci;
 lsmeans drug*catvar / DIFF MEANS ADJUST=BON 
                oddsratio CL EXP ;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For this output: I see the interaction effects of using Drug A (vs. Drug E) * Yes (vs. No). Is that correct?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.31.04 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73005iE5A55FD1712E7733/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.31.04 PM.png" alt="Screen Shot 2022-07-06 at 4.31.04 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.25.06 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73006i36EBD6D85A79033A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.25.06 PM.png" alt="Screen Shot 2022-07-06 at 4.25.06 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the estimates highlighted in purple box do not match. I was wondering why that is. When I compared the values in your previous example (without interaction) the values match. Please see output below.  &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.35.24 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73009iFF0377E30B2A2CC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.35.24 PM.png" alt="Screen Shot 2022-07-06 at 4.35.24 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-07-06 at 4.35.30 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73010i762EFEE10AC9FBF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2022-07-06 at 4.35.30 PM.png" alt="Screen Shot 2022-07-06 at 4.35.30 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Thanks!&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2022 21:25:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821941#M34953</guid>
      <dc:creator>varatt90</dc:creator>
      <dc:date>2022-07-06T21:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating multiple reference groups for a nominal variable in PROC GENMOD</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821955#M34957</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will answer that tomorrow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start with having a look here (see also the links to other material in this topic) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interpretation of interaction between categorical factors in logistic regression 1&lt;BR /&gt;Posted 11-05-2017 09:30 PM (3540 views)&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Interpretation-of-interaction-between-categorical-factors-in/td-p/410743" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/Interpretation-of-interaction-between-categorical-factors-in/td-p/410743&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 00:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Creating-multiple-reference-groups-for-a-nominal-variable-in/m-p/821955#M34957</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-07-07T00:38:28Z</dc:date>
    </item>
  </channel>
</rss>

