<?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: How to calculate prevalence ratio with a binary outcome in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-prevalence-ratio-with-a-binary-outcome/m-p/931447#M46430</link>
    <description>&lt;P&gt;See the &lt;A href="https://support.sas.com/kb/62/362.html" target="_self"&gt;NLMeans documentation&lt;/A&gt;. The Details section mentions the Hessian warning and that it can be ignored. Your GENMOD results probably seem backward because you didn't include the EVENT="1" response variable options like you did in LOGISTIC. Also, your model in GENMOD is a log-binomial model and it is prone to fitting errors as described in Note 23003 which suggests possible solutions. Finally, the Poisson model, also discussed in Note 23003, is another method indeed intended for a binary response, not a count response. In the example shown, notice that the OUTCOME variable is binary. That model is probably a better one to use than the log-binomial model because of the fitting problems that the latter can have.&lt;/P&gt;</description>
    <pubDate>Sun, 09 Jun 2024 15:58:10 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2024-06-09T15:58:10Z</dc:date>
    <item>
      <title>How to calculate prevalence ratio with a binary outcome</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-prevalence-ratio-with-a-binary-outcome/m-p/931412#M46414</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to calculate prevalence ratios in SAS with a binary outcome having many covariates.&lt;/P&gt;&lt;P&gt;Data look like this roughly:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data have;

input m$ a$ b$ c @@;
datalines;
0 1 0 34&amp;nbsp;1 2 0 56
1 3 1 54&amp;nbsp;0 2 1 23
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;m is a binary outcome (0 or 1), a (1, 2, or 3) and b (0 or 1) is categorical exposures, and c is continuous one.&lt;/P&gt;&lt;P&gt;In fact, I have more than 10 variables to be included in the dataset. Some of them are continuous and others are ordinal or binary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At first, I calculated odds ratios very easily as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc logistic data=have descending;
class a (ref="1")&amp;nbsp;b (ref="1")&amp;nbsp;&amp;nbsp;/ param=glm;
model m(event="1") = a b c;
lsmeans a&amp;nbsp; b c/ e ilink;
ods output coef=coeffs;
store out=ques;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So I tried calculate prevalence ratios with a macro:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%nlmeans(instore=ques, coef=coeffs, link=logit, options=ratio, title=Relative Risk)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But there was a warning message:&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final Hessian matrix is not positive definite, and therefore the estimated covariance matrix is not full&lt;BR /&gt;rank and may be unreliable. The variance of some parameter estimates is zero or some parameters are&lt;BR /&gt;linearly related to other parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried it using PROC GENMOD&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc genmod data=have descending;
class a (ref="1")&amp;nbsp;b (ref="1") ;
model m = a b c / dist=bin link=log type3 corrb;
estimate "RR for a1" a&amp;nbsp; 1 -1 0&amp;nbsp; /exp;

estimate "RR for a2" a 1 0 -1&amp;nbsp; /exp;
estimate "RR for b"b 1 -1&amp;nbsp; /exp;
estimate "RR for c" c 1&amp;nbsp; /exp;

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I also got a warning message like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;The relative Hessian convergence criterion of 0.0199906038 is greater than the limit of 0.0001. The
convergence is questionable.
WARNING: The procedure is continuing but the validity of the model fit is questionable.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In addition, the direction of estimates is totally different from the results out of PROC LOGISTIC.&lt;/P&gt;&lt;P&gt;For example, while I got the estimate 0.55 and 0.32 for each group of variable "a" from logistic regression, PROC GENMOD showed 1.44 and 3.56, respectively.&lt;/P&gt;&lt;P&gt;I want to estimate for all variables that I include.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I tried dist=poisson instead of bin, but I am not sure if this is correct.&lt;/P&gt;&lt;P&gt;I have reviewed this note (&lt;A href="https://support.sas.com/kb/23/003.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://support.sas.com/kb/23/003.html&lt;/A&gt;) but I guess this was calculated from count data. Mine has a binary outcome.&lt;/P&gt;&lt;P&gt;I've also heard that I could try calculate adjusted prevalence or marginal prevalence. But I have no idea how to calculate this in SAS.&lt;/P&gt;&lt;P&gt;Please help me out to estimate prevalence ratios correctly in this situation. Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 05:59:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-prevalence-ratio-with-a-binary-outcome/m-p/931412#M46414</guid>
      <dc:creator>nexterd</dc:creator>
      <dc:date>2024-06-09T05:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate prevalence ratio with a binary outcome</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-prevalence-ratio-with-a-binary-outcome/m-p/931447#M46430</link>
      <description>&lt;P&gt;See the &lt;A href="https://support.sas.com/kb/62/362.html" target="_self"&gt;NLMeans documentation&lt;/A&gt;. The Details section mentions the Hessian warning and that it can be ignored. Your GENMOD results probably seem backward because you didn't include the EVENT="1" response variable options like you did in LOGISTIC. Also, your model in GENMOD is a log-binomial model and it is prone to fitting errors as described in Note 23003 which suggests possible solutions. Finally, the Poisson model, also discussed in Note 23003, is another method indeed intended for a binary response, not a count response. In the example shown, notice that the OUTCOME variable is binary. That model is probably a better one to use than the log-binomial model because of the fitting problems that the latter can have.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Jun 2024 15:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-prevalence-ratio-with-a-binary-outcome/m-p/931447#M46430</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-06-09T15:58:10Z</dc:date>
    </item>
  </channel>
</rss>

