<?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: Log Binomial Regression - problem with Estimate in Proc Genmod in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878480#M43433</link>
    <description>&lt;P&gt;You just need to use the LSMEANS statement with the DIFF and EXP options as shown in the note I referred to.&amp;nbsp; To use the LSMEANS statement, you need to specify any predictors that you want relative risk estimates for in the CLASS statement. In the CLASS statement, you need to specify PARAM=GLM, not PARAM=REF.&amp;nbsp;You do not need the ESTIMATE statement unless you want a relative risk estimate for a 1- (or other sized) unit increase in a continuous (non-CLASS) predictor. The example in the note uses the LSMEANS statement for the CLASS predictor, A, and the ESTIMATE statement for the continuous predictor, X. You say you have predictors using a 5-point scale, so for each one you need to have a single variable with 5 possible values and you need to include it in the CLASS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following example uses the neuralgia data in the example titled "Logistic Modeling with Categorical Predictors" in the LOGISTIC documentation. The RANK procedure is used just to change the two continuous predictors into 3-level categorical predictors. The Exponentiated columns in the LSMEANS tables show the estimated probabilities at each level of each predictor. The Exponentiated columns in the Differences of LSMEANS tables show the relative risk estimates comparing each pair of levels as indicated in the very first two columns in each table.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=neuralgia out=tmp groups=3;
var duration age;
run;
proc genmod;
class Treatment Sex Age Duration / param=glm;
model Pain = Treatment Sex Age Duration / dist=bin link=log;
lsmeans Treatment Sex Age Duration / diff exp cl;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 31 May 2023 16:01:27 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2023-05-31T16:01:27Z</dc:date>
    <item>
      <title>Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878240#M43417</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm trying to run a log binomial regression on some cross-sectional data. I've been having some problems with Proc Genmod; it can do so many things and I'm not sure how to get it to do what I need it to.&amp;nbsp;I've been using &lt;A href="https://support.sas.com/resources/papers/proceedings11/345-2011.pdf" target="_blank" rel="noopener"&gt;this guide&lt;/A&gt; but I'm still lost.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Right now the Estimate statement is giving me errors that I'm not sure how to fix. It's been telling me that the categorical variable in that statement (hosp) first needs to appear in the model statement, which it does. Can anyone clarify what’s going wrong here? Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;Proc GenMod data=GC descending;
Class hosp  /param=ref ref=first;
Model hosp  =     Idthinklessn    Hithinklessn    Iddonttalkn      
    HIdonttalkn   connectn    ratherknown     normaln     explainn / Dist=bin Link=log;
Estimate 'minority stress and disease severity' hosp 1/exp;
Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Other info:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All minority stress variables (Idthinklessn Hithinklessn Iddonttalkn HIdonttalkn connectn ratherknown normaln explainn) use a numerical scale. Hosp is the only categorical.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Error message when run as-is:&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;ERROR: Effects used in the ESTIMATE statement must have appeared previously in the MODEL statement.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Other tinkering to Estimate produced:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;ERROR 22-322: Syntax error, expecting one of the following: a numeric constant, a datetime constant, (, *, +, -.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;I think I need something other than 1/exp but what and why?&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 14:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878240#M43417</guid>
      <dc:creator>akimme</dc:creator>
      <dc:date>2023-05-30T14:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878243#M43419</link>
      <description>&lt;P&gt;See &lt;A href="http://support.sas.com/kb/23003" target="_self"&gt;this note&lt;/A&gt; on estimating the relative risk, particularly the section on the log binomial model. As shown there, the variable specified in the ESTIMATE statement should be the predictor that you want to compute the relative risk for, not the response variable. If your predictors are binary, then it is easier to specify them in the CLASS statement which will then let you use the LSMEANS statement instead of the more difficult ESTIMATE statement. Or, you might want to avoid the problems with the log binomial model and the need to create the proper ESTIMATE statement by using the NLMeans macro approach that is shown in the earlier part of the note.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 15:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878243#M43419</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-05-30T15:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878391#M43428</link>
      <description>Unfortunately, all but one predictor is on a five point scale so it looks like I'm stuck with ESTIMATE. Can I use ESTIMATE for all of them or should I use it and LSMEANS together?&lt;BR /&gt;&lt;BR /&gt;Could you show me an example of what it would look like to use ESTIMATE for multiple predictors? I've only found examples with a single variable to be estimated.&lt;BR /&gt;&lt;BR /&gt;My advisor has recommended log binomial due to the study design (cross sectional) so I'm reluctant to change it. It seems to be a less common method though since I'm not finding much on it. Are there any other good overviews that you know of that could explain the parts of the code in detail?</description>
      <pubDate>Wed, 31 May 2023 10:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878391#M43428</guid>
      <dc:creator>akimme</dc:creator>
      <dc:date>2023-05-31T10:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878480#M43433</link>
      <description>&lt;P&gt;You just need to use the LSMEANS statement with the DIFF and EXP options as shown in the note I referred to.&amp;nbsp; To use the LSMEANS statement, you need to specify any predictors that you want relative risk estimates for in the CLASS statement. In the CLASS statement, you need to specify PARAM=GLM, not PARAM=REF.&amp;nbsp;You do not need the ESTIMATE statement unless you want a relative risk estimate for a 1- (or other sized) unit increase in a continuous (non-CLASS) predictor. The example in the note uses the LSMEANS statement for the CLASS predictor, A, and the ESTIMATE statement for the continuous predictor, X. You say you have predictors using a 5-point scale, so for each one you need to have a single variable with 5 possible values and you need to include it in the CLASS statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following example uses the neuralgia data in the example titled "Logistic Modeling with Categorical Predictors" in the LOGISTIC documentation. The RANK procedure is used just to change the two continuous predictors into 3-level categorical predictors. The Exponentiated columns in the LSMEANS tables show the estimated probabilities at each level of each predictor. The Exponentiated columns in the Differences of LSMEANS tables show the relative risk estimates comparing each pair of levels as indicated in the very first two columns in each table.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc rank data=neuralgia out=tmp groups=3;
var duration age;
run;
proc genmod;
class Treatment Sex Age Duration / param=glm;
model Pain = Treatment Sex Age Duration / dist=bin link=log;
lsmeans Treatment Sex Age Duration / diff exp cl;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 31 May 2023 16:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878480#M43433</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-05-31T16:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878808#M43453</link>
      <description>Ah, okay, thank you so much for spelling that out for me! One of the issues I had was that I put the outcome in the CLASS statement because it was categorical too. &lt;BR /&gt;&lt;BR /&gt;I haven't added in non-minority stress predictors (eg age), but some of those are continuous. I could use RANK on them too, I suppose. Otherwise, do you have any examples that use more continuous variables?</description>
      <pubDate>Thu, 01 Jun 2023 19:40:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878808#M43453</guid>
      <dc:creator>akimme</dc:creator>
      <dc:date>2023-06-01T19:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Log Binomial Regression - problem with Estimate in Proc Genmod</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878818#M43457</link>
      <description>&lt;P&gt;For binary or categorical response models fit by procedures like LOGISTIC, GENMOD, GEE, GLIMMIX, GAMPL, and so on, the response variable never needs to appear in the CLASS statement&amp;nbsp; and is best not entered there. As I mentioned, for a continuous predictor, you need to use the ESTIMATE statement. Again, the note I originally referred you to shows an example of estimating the relative risk for a 1 unit increase in the continuous variable, X. In that example, X interacts with A, but if it weren't involved in any interaction, then the relative risk estimate would be obtained with:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;estimate "RR (X+1)/X" x 1;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 20:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Log-Binomial-Regression-problem-with-Estimate-in-Proc-Genmod/m-p/878818#M43457</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2023-06-01T20:26:21Z</dc:date>
    </item>
  </channel>
</rss>

