<?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: Risk difference, NLmeans, not working. in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945545#M47250</link>
    <description>Post the parameter estimates table from the first NLMeans run. I suspect that the model fit shows problems.</description>
    <pubDate>Sun, 29 Sep 2024 01:37:12 GMT</pubDate>
    <dc:creator>StatDave</dc:creator>
    <dc:date>2024-09-29T01:37:12Z</dc:date>
    <item>
      <title>Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945540#M47245</link>
      <description>&lt;P&gt;I tried to calculate the risk difference using a multivariable logistic model with the macro NLmeans.&lt;/P&gt;&lt;P&gt;The following variables were included:&lt;BR /&gt;group (binary)&lt;BR /&gt;sex (binary)&lt;BR /&gt;weight (continuous)&lt;BR /&gt;year (continuous)&lt;BR /&gt;treatment1 (binary)&lt;BR /&gt;treatment2 (binary)&lt;BR /&gt;treatment3 (binary)&lt;BR /&gt;town (5 categories)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, when I run the code as shown below, it produces missing values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data = dat;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;class group(ref="0") sex treatment1 treatment2 treatment3 town / param = glm;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;model style(event="1") = group sex weight year treatment1 treatment2 treatment3 town / link = logit;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;lsmeans group / e ilink;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;ods output coef=coef1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;store clog1;&lt;BR /&gt;run;&lt;BR /&gt;%nlmeans(instore=clog1, coef=coef1, link=logit)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 729px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100728iACC39BB710D8209C/image-dimensions/729x671?v=v2" width="729" height="671" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I exclude the two continuous variables from the model, it works well.&lt;/P&gt;&lt;P&gt;proc logistic data = dat;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;class group(ref="0") sex treatment1 treatment2 treatment3 town / param = glm;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;model style(event="1") = group sex treatment1 treatment2 treatment3 town / link = logit;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;lsmeans group / e ilink;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;ods output coef=coef2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;store clog2;&lt;BR /&gt;run;&lt;BR /&gt;%nlmeans(instore=clog2, coef=coef2, link=logit)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture4.PNG" style="width: 629px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100729i1671330045B37BC5/image-dimensions/629x580?v=v2" width="629" height="580" role="button" title="Capture4.PNG" alt="Capture4.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any reason why the model fails to work when the continuous variables are included?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2024 21:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945540#M47245</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-28T21:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945543#M47248</link>
      <description>1) Is there any WARNING or ERROR info in SAS LOG ?&lt;BR /&gt;2) Better post your dataset, so can test your code to see where is wrong.&lt;BR /&gt;3) Did you try other ways? Like :PROC GENMOD or PROC CATMOD</description>
      <pubDate>Sun, 29 Sep 2024 01:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945543#M47248</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-29T01:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945544#M47249</link>
      <description>&lt;P&gt;I only got a warning of the positive hessian matrix below&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;PRE&gt;WARNING: The final Hessian matrix is not positive definite, and therefore the estimated
         covariance matrix is not full rank and may be unreliable.  The variance of some
         parameter estimates is zero or some parameters are linearly related to other
         parameters.&lt;/PRE&gt;&lt;P&gt;However,&amp;nbsp; it seems like that is not an issue since both models obtained the same warning,&lt;/P&gt;&lt;P&gt;Also, I had to run a conditional logistic model, which uses proc logistic with strata option that proc genmod does not provide&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945544#M47249</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-29T01:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945545#M47250</link>
      <description>Post the parameter estimates table from the first NLMeans run. I suspect that the model fit shows problems.</description>
      <pubDate>Sun, 29 Sep 2024 01:37:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945545#M47250</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-09-29T01:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945546#M47251</link>
      <description>&lt;P&gt;When I run proc logistic, it does not show any warnings or errors.&lt;/P&gt;&lt;P&gt;Also, when I run NLMeans, it only shows the differences with its confidence intervals, which provides a missing value&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945546#M47251</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-29T01:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945547#M47252</link>
      <description>You could try other options:&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/62/362.html" target="_blank"&gt;https://support.sas.com/kb/62/362.html&lt;/A&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945547#M47252</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-29T01:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945549#M47253</link>
      <description>&lt;P&gt;Not all model fitting problems cause warnings or errors in the log. Again, please post the parameter estimates table from the model fit. The large standard errors in the LSMEANS results suggest a problem.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945549#M47253</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-09-29T01:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945551#M47254</link>
      <description>&lt;P&gt;Thanks! I will post the parameter estimates table once I have access to the data!&lt;/P&gt;&lt;P&gt;I remember the standard errors were not that big, but some towns had separation issue.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945551#M47254</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-29T01:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945552#M47255</link>
      <description>&lt;P&gt;Sorry what do you mean by other options?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945552#M47255</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-29T01:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945554#M47256</link>
      <description>&lt;P&gt;Separation is exactly the problem I suspect. If that is the case, some of the model parameter estimates are infinite making the model useless. Simplifying the model, as you did can help, though even in the second run the standard errors on the estimates are very large and you can see that the confidence intervals are essentially the entire valid probability range [0,1]. Another possible solution is to use the FIRTH option in the model fit to use a penalized likelihood.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 01:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945554#M47256</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-09-29T01:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945555#M47257</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1727575078196.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100730i64FABEF0084A2D77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1727575078196.png" alt="Ksharp_0-1727575078196.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 02:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945555#M47257</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-29T02:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945556#M47258</link>
      <description>&lt;P&gt;Okay, I will try to exclude such variables, which causes the separation!&lt;/P&gt;&lt;P&gt;Just wondered I found that I could obtain the odds ratio of the variable, group, but not the risk difference.&lt;/P&gt;&lt;P&gt;Is there any reason for that??&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2024 02:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945556#M47258</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-29T02:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945558#M47259</link>
      <description>Again, you could also try using the FIRTH option with your full model. But you need to have no separation issues and the parameter standard errors should be small.</description>
      <pubDate>Sun, 29 Sep 2024 02:06:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945558#M47259</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-09-29T02:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945698#M47268</link>
      <description>&lt;P&gt;Although I have added additional independent variables as listed below, I am still encountering the same problem, even though there is no separation.&lt;/P&gt;&lt;P&gt;I also checked the VIF of the variables, and all eigenvalues were less than 2.5. However, I received the following warning when I ran nlmeans:&lt;/P&gt;&lt;P&gt;"WARNING: The final Hessian matrix is not positive definite, and&lt;BR /&gt;therefore the estimated covariance matrix is not full rank and&lt;BR /&gt;may be unreliable. The variance of some parameter estimates is&lt;BR /&gt;zero or some parameters are linearly related to other&lt;BR /&gt;parameters."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Belows are the results after running proc logistics and nlmeans.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture7.PNG" style="width: 456px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100760i106F30A5E64C41D5/image-dimensions/456x715?v=v2" width="456" height="715" role="button" title="Capture7.PNG" alt="Capture7.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture8.PNG" style="width: 419px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100761i5548015EFCE93CCA/image-dimensions/419x534?v=v2" width="419" height="534" role="button" title="Capture8.PNG" alt="Capture8.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture11.PNG" style="width: 1154px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100763i1264023F2AAD7D42/image-dimensions/1154x475?v=v2" width="1154" height="475" role="button" title="Capture11.PNG" alt="Capture11.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture9.PNG" style="width: 903px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100762iC5C0FBD83DA786FE/image-dimensions/903x147?v=v2" width="903" height="147" role="button" title="Capture9.PNG" alt="Capture9.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture10.PNG" style="width: 545px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100764i02012BFBAE9FAAD8/image-dimensions/545x60?v=v2" width="545" height="60" role="button" title="Capture10.PNG" alt="Capture10.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that excluding either only "year2" or both "weight and year1" variables led the model working well, but I need to include all of them.&lt;/P&gt;&lt;P&gt;Thanks!&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 14:14:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945698#M47268</guid>
      <dc:creator>leesw0212</dc:creator>
      <dc:date>2024-09-30T14:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Risk difference, NLmeans, not working.</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945722#M47271</link>
      <description>&lt;P&gt;The intercept parameter and its standard error are both very large for a logistic model and is still suggesting a problem. Was this done with the FIRTH option or not? If no, try using it. If yes, then you will need to simplify the model somehow to get a model that fits without evidence of problems - you should have no messages in the log about separation. Note that for a&amp;nbsp; generalized model like a logistic model you cannot just run the model through PROC REG to get VIF values. See &lt;A href="http://support.sas.com/kb/32471" target="_self"&gt;this note&lt;/A&gt; for assessing collinearity for generalized models. As noted in the &lt;A href="http://support.sas.com/kb/62362" target="_self"&gt;NLMeans macro documentation&lt;/A&gt;, the Hessian warning will occur any time that the GLM parameterization (PARAM=GLM) is used in the model read into the macro.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 19:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Risk-difference-NLmeans-not-working/m-p/945722#M47271</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2024-09-30T19:37:38Z</dc:date>
    </item>
  </channel>
</rss>

