<?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: odds ratio, set multiple reference groups for logistic regression in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/odds-ratio-set-multiple-reference-groups-for-logistic-regression/m-p/520537#M4046</link>
    <description>&lt;P&gt;Welcome to the SAS forums.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does help if you post code so we can see what you've tried and what you're doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get the results you'd like using the ODDSRATIO statement. Not sure it gets you all the way there and will depend a bit on your model, especially if you have other categorical variables. Take a look at the output from the code below and see how it works and if it solves your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;title 'Example 2. Modeling with Categorical Predictors';

data Neuralgia;
   input Treatment $ Sex $ Age Duration Pain $ @@;
   datalines;
P  F  68   1  No   B  M  74  16  No  P  F  67  30  No
P  M  66  26  Yes  B  F  67  28  No  B  F  77  16  No
A  F  71  12  No   B  F  72  50  No  B  F  76   9  Yes
A  M  71  17  Yes  A  F  63  27  No  A  F  69  18  Yes
B  F  66  12  No   A  M  62  42  No  P  F  64   1  Yes
A  F  64  17  No   P  M  74   4  No  A  F  72  25  No
P  M  70   1  Yes  B  M  66  19  No  B  M  59  29  No
A  F  64  30  No   A  M  70  28  No  A  M  69   1  No
B  F  78   1  No   P  M  83   1  Yes B  F  69  42  No
B  M  75  30  Yes  P  M  77  29  Yes P  F  79  20  Yes
A  M  70  12  No   A  F  69  12  No  B  F  65  14  No
B  M  70   1  No   B  M  67  23  No  A  M  76  25  Yes
P  M  78  12  Yes  B  M  77   1  Yes B  F  69  24  No
P  M  66   4  Yes  P  F  65  29  No  P  M  60  26  Yes
A  M  78  15  Yes  B  M  75  21  Yes A  F  67  11  No
P  F  72  27  No   P  F  70  13  Yes A  M  75   6  Yes
B  F  65   7  No   P  F  68  27  Yes P  M  68  11  Yes
P  M  67  17  Yes  B  M  70  22  No  A  M  65  15  No
P  F  67   1  Yes  A  M  67  10  No  P  F  72  11  Yes
A  F  74   1  No   B  M  80  21  Yes A  F  69   3  No
;

proc logistic data=Neuralgia;
   class Treatment Sex;
   model Pain= Treatment Sex Treatment*Sex Age Duration / expb;
&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;   oddsratio treatment / diff=all;&lt;/STRONG&gt;&lt;/FONT&gt;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250784"&gt;@kaimcqueen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This might be a silly question, but if I have four groups for my categorical variable and I want to get the full logistic model with odds ratios and model estimates such that each of the three comparisons are made in this way:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A vs. B&lt;/P&gt;
&lt;P&gt;A vs. C&lt;/P&gt;
&lt;P&gt;A vs. D&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I set up the SAS code in proc logistic to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only know of setting the reference group, but here the reference group changes (B, C, and D).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know I can set the reference group up separately as B and run the code and get the estimates for A vs. B, and then set the reference group up as C and get estimates for A vs. C...etc. But then I cannot get the intercept estimates for the model in which it is A vs. everything else. So, how can I get the full model of A vs. B, A vs. C, and A vs. D in one single run?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or will the intercept estimates of the model be the same as the intercept estimates of the model in which A is simply set up as the reference group (i.e., B vs. A, C vs. A, D vs. A)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see attached PDF, as that picture is easier to understand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 20:44:43 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-12-11T20:44:43Z</dc:date>
    <item>
      <title>odds ratio, set multiple reference groups for logistic regression</title>
      <link>https://communities.sas.com/t5/New-SAS-User/odds-ratio-set-multiple-reference-groups-for-logistic-regression/m-p/520509#M4039</link>
      <description>&lt;P&gt;This might be a silly question, but if I have four groups for my categorical variable and I want to get the full logistic model with odds ratios and model estimates such that each of the three comparisons are made in this way:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A vs. B&lt;/P&gt;&lt;P&gt;A vs. C&lt;/P&gt;&lt;P&gt;A vs. D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I set up the SAS code in proc logistic to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only know of setting the reference group, but here the reference group changes (B, C, and D).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know I can set the reference group up separately as B and run the code and get the estimates for A vs. B, and then set the reference group up as C and get estimates for A vs. C...etc. But then I cannot get the intercept estimates for the model in which it is A vs. everything else. So, how can I get the full model of A vs. B, A vs. C, and A vs. D in one single run?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or will the intercept estimates of the model be the same as the intercept estimates of the model in which A is simply set up as the reference group (i.e., B vs. A, C vs. A, D vs. A)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see attached PDF, as that picture is easier to understand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 19:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/odds-ratio-set-multiple-reference-groups-for-logistic-regression/m-p/520509#M4039</guid>
      <dc:creator>kaimcqueen</dc:creator>
      <dc:date>2018-12-11T19:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: odds ratio, set multiple reference groups for logistic regression</title>
      <link>https://communities.sas.com/t5/New-SAS-User/odds-ratio-set-multiple-reference-groups-for-logistic-regression/m-p/520537#M4046</link>
      <description>&lt;P&gt;Welcome to the SAS forums.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It does help if you post code so we can see what you've tried and what you're doing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get the results you'd like using the ODDSRATIO statement. Not sure it gets you all the way there and will depend a bit on your model, especially if you have other categorical variables. Take a look at the output from the code below and see how it works and if it solves your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;title 'Example 2. Modeling with Categorical Predictors';

data Neuralgia;
   input Treatment $ Sex $ Age Duration Pain $ @@;
   datalines;
P  F  68   1  No   B  M  74  16  No  P  F  67  30  No
P  M  66  26  Yes  B  F  67  28  No  B  F  77  16  No
A  F  71  12  No   B  F  72  50  No  B  F  76   9  Yes
A  M  71  17  Yes  A  F  63  27  No  A  F  69  18  Yes
B  F  66  12  No   A  M  62  42  No  P  F  64   1  Yes
A  F  64  17  No   P  M  74   4  No  A  F  72  25  No
P  M  70   1  Yes  B  M  66  19  No  B  M  59  29  No
A  F  64  30  No   A  M  70  28  No  A  M  69   1  No
B  F  78   1  No   P  M  83   1  Yes B  F  69  42  No
B  M  75  30  Yes  P  M  77  29  Yes P  F  79  20  Yes
A  M  70  12  No   A  F  69  12  No  B  F  65  14  No
B  M  70   1  No   B  M  67  23  No  A  M  76  25  Yes
P  M  78  12  Yes  B  M  77   1  Yes B  F  69  24  No
P  M  66   4  Yes  P  F  65  29  No  P  M  60  26  Yes
A  M  78  15  Yes  B  M  75  21  Yes A  F  67  11  No
P  F  72  27  No   P  F  70  13  Yes A  M  75   6  Yes
B  F  65   7  No   P  F  68  27  Yes P  M  68  11  Yes
P  M  67  17  Yes  B  M  70  22  No  A  M  65  15  No
P  F  67   1  Yes  A  M  67  10  No  P  F  72  11  Yes
A  F  74   1  No   B  M  80  21  Yes A  F  69   3  No
;

proc logistic data=Neuralgia;
   class Treatment Sex;
   model Pain= Treatment Sex Treatment*Sex Age Duration / expb;
&lt;FONT size="4" color="#800080"&gt;&lt;STRONG&gt;   oddsratio treatment / diff=all;&lt;/STRONG&gt;&lt;/FONT&gt;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/250784"&gt;@kaimcqueen&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;This might be a silly question, but if I have four groups for my categorical variable and I want to get the full logistic model with odds ratios and model estimates such that each of the three comparisons are made in this way:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A vs. B&lt;/P&gt;
&lt;P&gt;A vs. C&lt;/P&gt;
&lt;P&gt;A vs. D&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I set up the SAS code in proc logistic to do this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only know of setting the reference group, but here the reference group changes (B, C, and D).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know I can set the reference group up separately as B and run the code and get the estimates for A vs. B, and then set the reference group up as C and get estimates for A vs. C...etc. But then I cannot get the intercept estimates for the model in which it is A vs. everything else. So, how can I get the full model of A vs. B, A vs. C, and A vs. D in one single run?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or will the intercept estimates of the model be the same as the intercept estimates of the model in which A is simply set up as the reference group (i.e., B vs. A, C vs. A, D vs. A)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please see attached PDF, as that picture is easier to understand.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 20:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/odds-ratio-set-multiple-reference-groups-for-logistic-regression/m-p/520537#M4046</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-11T20:44:43Z</dc:date>
    </item>
  </channel>
</rss>

