<?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: Zero inflated NB in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Zero-inflated-NB/m-p/810317#M319552</link>
    <description>&lt;P&gt;Advice: Using tabs leads to the misaligned code you provided. Use spaces to keep formatting consistent.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I cannot answer the question itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 10:55:31 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2022-04-28T10:55:31Z</dc:date>
    <item>
      <title>Zero inflated NB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zero-inflated-NB/m-p/810121#M319466</link>
      <description>&lt;P&gt;Is there a sample code available to run random effect zero inflated negative binomial model for count data?&lt;/P&gt;&lt;P&gt;I found a program for random effect zero inflated poison from here:&amp;nbsp;&lt;A href="https://stats.oarc.ucla.edu/sas/faq/how-do-i-run-a-random-effect-zero-inflated-poisson-model-using-nlmixed/" target="_blank"&gt;https://stats.oarc.ucla.edu/sas/faq/how-do-i-run-a-random-effect-zero-inflated-poisson-model-using-nlmixed/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;How to modify it to run negative binomial zero inflated data? code was pasted below. Thank you!&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc nlmixed data = hdp method=gauss qpoints=25;
  parms b0=1.0569 b1=-0.0020 b2=0.0094 b3=0.0122 b4=0.0239 b5=0.0530 b6=0.1322
        a0=-1.6766 a1=-0.0116 a2=0.7479 a3=1.2588 a4=-0.8077 a5=-2.1410 a6=-2.7530 	
        sigma2=0.2414;
  logit0 = a0 + a1*Age + a2*SmokingHx2 + a3*SmokingHx3 +
    a4*CancerStage2 + a5*CancerStage3 + a6*CancerStage4;
  prob0 = 1 / (1 + exp(-logit0));
  mu = exp(b0 + u + b1*Age + b2*LengthofStay + b3*BMI + 
    b4*CancerStage2 + b5*CancerStage3 + b6*CancerStage4);
  if nmorphine = 0 then
    ll = log(prob0 + (1 - prob0)*exp(-mu));
  else
	ll = nmorphine*log(mu) + log(1 - prob0) - mu - lgamma(nmorphine + 1);
  model nmorphine ~ general(ll);
  random u ~ normal(0, sigma2) subject=DID;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 12:25:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zero-inflated-NB/m-p/810121#M319466</guid>
      <dc:creator>Visiting</dc:creator>
      <dc:date>2022-04-27T12:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Zero inflated NB</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Zero-inflated-NB/m-p/810317#M319552</link>
      <description>&lt;P&gt;Advice: Using tabs leads to the misaligned code you provided. Use spaces to keep formatting consistent.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I cannot answer the question itself.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 10:55:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Zero-inflated-NB/m-p/810317#M319552</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2022-04-28T10:55:31Z</dc:date>
    </item>
  </channel>
</rss>

