<?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: Multinomial logistic regression - multiple dependent variable group comparisons in the same mode in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539074#M27079</link>
    <description>&lt;P&gt;Computing a similar, and somewhat more intuitive and useful statistic, is discussed and illustrated in &lt;A href="http://support.sas.com/kb/57798" target="_self"&gt;this note&lt;/A&gt;. See the second section that discusses comparing probabilities of two response levels.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Feb 2019 18:27:34 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2019-02-27T18:27:34Z</dc:date>
    <item>
      <title>Multinomial logistic regression - multiple dependent variable group comparisons in the same model</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/538840#M27073</link>
      <description>&lt;P&gt;I am trying to run a multinomial logistic regression model in SAS using PROC LOGISTIC and would like to know if it is possible to produce multiple dependent variable group comparisons &lt;STRONG&gt;&lt;EM&gt;in the same single model&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am predicting the odds that an individual is in an alcohol use group (see groups below) with a few predictor variables (e.g., age, gender, race/ethnicity, and whether they have asthma). I am primarily interested in calculating the odds ratio of being in the abstinent group (no alcohol use) in people with asthma versus people without asthma.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alcohol use group ~ Age + Gender + Race + Asthma&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alcohol use group&lt;/P&gt;&lt;P&gt;0 = abstinent&lt;/P&gt;&lt;P&gt;1 = moderate&lt;/P&gt;&lt;P&gt;2 = excessive&lt;/P&gt;&lt;P&gt;3 = very excessive&lt;/P&gt;&lt;P&gt;4 = hazardous&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the following code to estimate odds ratios with the abstinent group as my reference group (1 vs 0, 2 vs 0, 3 vs 0, 4 vs 0). However, I want to also make these group comparisons:&lt;/P&gt;&lt;P&gt;1) 0 vs 1&lt;/P&gt;&lt;P&gt;2) 0 vs 2/3/4&lt;/P&gt;&lt;P&gt;3) 1 vs 2&lt;/P&gt;&lt;P&gt;4) 1 vs 3&lt;/P&gt;&lt;P&gt;5) 1 vs 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=&amp;amp;mydata;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class female(ref='0')&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;agegrp(ref='1')&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;racegrp6(ref='1')&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asthma(ref='0')&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/ param=ref;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model alcgrp&lt;STRONG&gt;(ref='0')&lt;/STRONG&gt; = female agegrp racegrp6 asthma / link=glogit expb cl;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; estimate "log asthma_1" asthma 1 /exp cl category="1";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; estimate "log asthma_1" asthma 1 /exp cl category="2";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; estimate "log asthma_1" asthma 1 /exp cl category="3";&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; estimate "log asthma_1" asthma 1 /exp cl category="4";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I basically want to change my reference group for each comparison. I don't know how to do this without running multiple models where each one has a different reference group (code in bold above). I also want to group people with excessive drinking or higher into one group for one comparison, so ideally I would not be running two different sets of models (one with a 3-level dependent variable, and one with a 4- or 5-level dependent variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are my primary questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q1) Is there a way to calculate the inverse of an odds ratio and its corresponding 95% confidence interval and p-value using the parameters estimated from a single model in SAS? I could calculate these by hand, but it would be useless for conducting the significance z-test. For example, my model gives me the odds ratio comparing 1 vs 0, but how do I test the inverse of 0 vs 1, without running another model?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q2) How do I create a contrast for multinomial logistic regression models in SAS where I would be "adding the probability" of being in multiple groups? For example, if I have a 5-level dependent variable, how do I use the parameters and collapse across levels to generate the test I want (0 vs 2/3/4)?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Feb 2019 22:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/538840#M27073</guid>
      <dc:creator>vpalzes</dc:creator>
      <dc:date>2019-02-26T22:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multinomial logistic regression - multiple dependent variable group comparisons in the same mode</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539074#M27079</link>
      <description>&lt;P&gt;Computing a similar, and somewhat more intuitive and useful statistic, is discussed and illustrated in &lt;A href="http://support.sas.com/kb/57798" target="_self"&gt;this note&lt;/A&gt;. See the second section that discusses comparing probabilities of two response levels.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 18:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539074#M27079</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2019-02-27T18:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multinomial logistic regression - multiple dependent variable group comparisons in the same mode</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539181#M27083</link>
      <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to also combine the probabilities of multiple response-level groups for one of my comparisons (e.g., group 0 vs groups 2-4). It seems like the NLMeans macro cannot handle such a contrast for ratios.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm also afraid that I'm getting much different OR estimates with this method versus the reference-coding method that I have used previously.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This method:&lt;/P&gt;&lt;P&gt;OR comparing 0 vs 1 = 1.65 (1.52-1.78)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 2 = 1.08 (1.01-1.14)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 3 = 1.22 (1.15-1.29)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 4 = 1.50 (1.33-1.66)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previous reference-coding method with multiple models (changing the reference group):&lt;/P&gt;&lt;P&gt;OR comparing 0 vs 1 = 1.25 (1.20-1.28)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 2 = 0.99 (0.93-1.06)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 3 = 0.99 (0.93-1.05)&lt;/P&gt;&lt;P&gt;OR comparing 1 vs 4 = 1.09 (0.98-1.20)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code based on the &lt;A href="http://support.sas.com/kb/57798" target="_self"&gt;tutorial here:&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=&amp;amp;mydata;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; class female agegrp racegrp6 asthma / param=glm;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; model alcgrp = female agegrp racegrp6 asthma / link=glogit;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; lsmeans asthma / e ilink;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ods output coef=coeffs;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; output out=LogOR xbeta=xb stdxbeta=s;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; store out=logmod;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data cont;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; length label $40;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; infile datalines missover;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; input label k1-k10;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set=1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; datalines;&lt;BR /&gt;P(dx,0)/P(dx,1)&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; &amp;nbsp; 1 -1&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&lt;BR /&gt;P(dx,1)/P(dx,2)&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 1 -1&amp;nbsp; 0&amp;nbsp; 0&lt;BR /&gt;P(dx,1)/P(dx,3)&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 1&amp;nbsp; 0 -1&amp;nbsp; 0&lt;BR /&gt;P(dx,1)/P(dx,4)&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; 0&amp;nbsp; &amp;nbsp; 0&amp;nbsp; 1&amp;nbsp; 0&amp;nbsp; 0 -1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;%NLMeans(instore=logmod, coef=coeffs, link=glogit, options=ratio, contrasts=cont, title=Alcohol Group ORs for Patients with Asthma);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: These contrast lines can only have one 1 and one -1. For example, I cannot do:&lt;/P&gt;&lt;P&gt;P(dx,0)/P(dx,2-4)&amp;nbsp; &amp;nbsp; &amp;nbsp;0 0 0 0 0&amp;nbsp; &amp;nbsp; &amp;nbsp;1 0 -0.334 -0.333 -0.333&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, I recieve this error:&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR: OPTIONS=RATIO requires all contrasts to contain a single 1&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;for the numerator, a single -1 for the denominator, and&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;zeros otherwise.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&lt;FONT color="#FF0000"&gt;ERROR: The above message is for estimate set 1.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Feb 2019 23:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539181#M27083</guid>
      <dc:creator>vpalzes</dc:creator>
      <dc:date>2019-02-27T23:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multinomial logistic regression - multiple dependent variable group comparisons in the same mode</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539351#M27085</link>
      <description>&lt;P&gt;If you want to contrast the 0 and 2-4 levels of response, then you really just want a binary response model. The easiest way would be to create a dichotomized version of your response and fit a binary logistic model to it. &amp;nbsp;However, if you are determined to do it in the context of the multinomial model, then you can use the NLEstimate macro to estimate a suitable expression for the desired function. Using the schools and instruction styles example in the note I referred to, suppose you want to estimate the relative risk that contrasts the self and team styles vs. the class style in school 1. That is a dichotomization of the response levels like what you want. Writing this in terms of the response probabilities, suppose you want to estimate the relative risk (p_self+p_team)/p_class in school 1. Writing this in terms of the parameters of the multinomial model, the function to estimate is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;exp(intercept_self+school1_self) + exp(intercept_team+school1_team)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which can then be used in the FDATA= data set used by NLEstimate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [P(self,S1)+P(team,S1)]/P(class,S1) | exp(b_p1+b_p3)+exp(b_p2+b_p4)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mentioned getting different OR estimates… The NLMeans macro with options=ratio will estimate relative risks as stated in the note I referred to, not odds ratios. If you want to estimate odds ratios, you will need to estimate suitable expressions in the NLEstimate macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Feb 2019 16:04:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Multinomial-logistic-regression-multiple-dependent-variable/m-p/539351#M27085</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2019-02-28T16:04:37Z</dc:date>
    </item>
  </channel>
</rss>

