<?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 High standard errors on estimates of p in logistic regression using categorical predictors in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/High-standard-errors-on-estimates-of-p-in-logistic-regression/m-p/510656#M26147</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am performing logistic regression in&amp;nbsp;PROC GLIMMIX (binomial distribution, logit link, SAS version 9.4) using categorical predictors and am coming across a strange phenomenon:&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;the response variable of certain level of a categorical predictor&amp;nbsp;comprioses mostly or all zero values (my data are represented by 0s ands 1s -I am modelling the probability of occurrence of 1s), when I perform lsmean estimates of the probability of occurrence of 1 (p), the standard error and breadth of 95% CIs for the estimate of p for that level is high; if all values of that level are zero the SE is very high and the 95% CI ranges from 0 to 1. As a result, pairwise post-hoc comparisons made with this level are rarely significant (or never if all values are 0), even though I&amp;nbsp;might expect them to be.&lt;/P&gt;
&lt;P&gt;I find this odd because I thought that standard error for a binomially distributed variable becomes smaller when, for a given n, p approaches 0 (or 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted some example data and code for a simple example with one independent categorical variable (Cat1).&lt;/P&gt;
&lt;P&gt;For level "RE", all values but one of the responding variable "Y1" are 0. For the responding variable "Y2" all values for level "RE" are 0. If you run the code, below, you can see that the SE for RE is high in the former case, and very high (with 95%CIs of p ranging from 0 to 1) in the latter case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note-I am using GLIMMIX because&amp;nbsp;I am ultimately included random factors in this model, but&amp;nbsp;I did a bit of experimenting in PROC genmod and proc logistic and I think the same thing more or less occurs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain what causes this phenomenon, or -in the case it is an error in my coding-what I may be doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*case where Y1 has only one non-zero value in Cat1="RE";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC GLIMMIX data=Fake_Data2;&lt;BR /&gt; CLASS Cat1 ;&lt;BR /&gt; MODEL Y1 = Cat1 / DIST=bin LINK=logit SOLUTION;&lt;BR /&gt; LSMEANS Cat1 / CL ADJUST= tukey ilink;&lt;BR /&gt; RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*case where Y2 has all zero values in Cat1="RE";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC GLIMMIX data=Fake_Data2;&lt;BR /&gt; CLASS Cat1 ;&lt;BR /&gt; MODEL Y2 = Cat1 / DIST=bin LINK=logit SOLUTION ;&lt;BR /&gt; LSMEANS Cat1 / CL ADJUST= tukey ilink;&lt;BR /&gt; RUN;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 01:01:20 GMT</pubDate>
    <dc:creator>Kojema</dc:creator>
    <dc:date>2018-11-06T01:01:20Z</dc:date>
    <item>
      <title>High standard errors on estimates of p in logistic regression using categorical predictors</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/High-standard-errors-on-estimates-of-p-in-logistic-regression/m-p/510656#M26147</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am performing logistic regression in&amp;nbsp;PROC GLIMMIX (binomial distribution, logit link, SAS version 9.4) using categorical predictors and am coming across a strange phenomenon:&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;the response variable of certain level of a categorical predictor&amp;nbsp;comprioses mostly or all zero values (my data are represented by 0s ands 1s -I am modelling the probability of occurrence of 1s), when I perform lsmean estimates of the probability of occurrence of 1 (p), the standard error and breadth of 95% CIs for the estimate of p for that level is high; if all values of that level are zero the SE is very high and the 95% CI ranges from 0 to 1. As a result, pairwise post-hoc comparisons made with this level are rarely significant (or never if all values are 0), even though I&amp;nbsp;might expect them to be.&lt;/P&gt;
&lt;P&gt;I find this odd because I thought that standard error for a binomially distributed variable becomes smaller when, for a given n, p approaches 0 (or 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted some example data and code for a simple example with one independent categorical variable (Cat1).&lt;/P&gt;
&lt;P&gt;For level "RE", all values but one of the responding variable "Y1" are 0. For the responding variable "Y2" all values for level "RE" are 0. If you run the code, below, you can see that the SE for RE is high in the former case, and very high (with 95%CIs of p ranging from 0 to 1) in the latter case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note-I am using GLIMMIX because&amp;nbsp;I am ultimately included random factors in this model, but&amp;nbsp;I did a bit of experimenting in PROC genmod and proc logistic and I think the same thing more or less occurs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain what causes this phenomenon, or -in the case it is an error in my coding-what I may be doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any help!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*case where Y1 has only one non-zero value in Cat1="RE";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC GLIMMIX data=Fake_Data2;&lt;BR /&gt; CLASS Cat1 ;&lt;BR /&gt; MODEL Y1 = Cat1 / DIST=bin LINK=logit SOLUTION;&lt;BR /&gt; LSMEANS Cat1 / CL ADJUST= tukey ilink;&lt;BR /&gt; RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*case where Y2 has all zero values in Cat1="RE";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC GLIMMIX data=Fake_Data2;&lt;BR /&gt; CLASS Cat1 ;&lt;BR /&gt; MODEL Y2 = Cat1 / DIST=bin LINK=logit SOLUTION ;&lt;BR /&gt; LSMEANS Cat1 / CL ADJUST= tukey ilink;&lt;BR /&gt; RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 01:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/High-standard-errors-on-estimates-of-p-in-logistic-regression/m-p/510656#M26147</guid>
      <dc:creator>Kojema</dc:creator>
      <dc:date>2018-11-06T01:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: High standard errors on estimates of p in logistic regression using categorical predictors</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/High-standard-errors-on-estimates-of-p-in-logistic-regression/m-p/510726#M26152</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/40669"&gt;@Kojema&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am performing logistic regression in&amp;nbsp;PROC GLIMMIX (binomial distribution, logit link, SAS version 9.4) using categorical predictors and am coming across a strange phenomenon:&lt;/P&gt;
&lt;P&gt;If&amp;nbsp;the response variable of certain level of a categorical predictor&amp;nbsp;comprioses mostly or all zero values (my data are represented by 0s ands 1s -I am modelling the probability of occurrence of 1s), when I perform lsmean estimates of the probability of occurrence of 1 (p), the standard error and breadth of 95% CIs for the estimate of p for that level is high; if all values of that level are zero the SE is very high and the 95% CI ranges from 0 to 1. As a result, pairwise post-hoc comparisons made with this level are rarely significant (or never if all values are 0), even though I&amp;nbsp;might expect them to be.&lt;/P&gt;
&lt;P&gt;I find this odd because I thought that standard error for a binomially distributed variable becomes smaller when, for a given n, p approaches 0 (or 1).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted some example data and code for a simple example with one independent categorical variable (Cat1).&lt;/P&gt;
&lt;P&gt;For level "RE", all values but one of the responding variable "Y1" are 0. For the responding variable "Y2" all values for level "RE" are 0. If you run the code, below, you can see that the SE for RE is high in the former case, and very high (with 95%CIs of p ranging from 0 to 1) in the latter case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note-I am using GLIMMIX because&amp;nbsp;I am ultimately included random factors in this model, but&amp;nbsp;I did a bit of experimenting in PROC genmod and proc logistic and I think the same thing more or less occurs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone explain what causes this phenomenon, or -in the case it is an error in my coding-what I may be doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The probability that you mention accounts only for a portion of the variability of the estimate of p. It also depends on how well the Y variables are predicted by the predictor variable, and it could also be that one level of CAT1 predicts well while the other level of CAT2 predicts poorly. All of these things can inflate the&amp;nbsp;standard errors.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 12:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/High-standard-errors-on-estimates-of-p-in-logistic-regression/m-p/510726#M26152</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-11-06T12:45:34Z</dc:date>
    </item>
  </channel>
</rss>

