<?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 How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789248#M38698</link>
    <description>&lt;P&gt;I've recently fit a&amp;nbsp;zero-inflated negative binomial distribution to hospital inpatient visit data using proc genmod:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc genmod data = IP_count_data;
  	model Y = / dist=zinb;
  	zeromodel;
	output out=ZINBFit p=p pzero=pzero;
	ods output ZeroParameterEstimates = ZeroParameterEstimates; 
	ods output ParameterEstimates = ParameterEstimates;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'd like to randomly generate observations Y from this same zero-inflated negative binomial distribution. This can be done using the following expression, pulled from an&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-generation-from-the-Zero-Modified-Negative-Binomial-dist/td-p/95511" target="_self"&gt;earlier question&lt;/A&gt;&amp;nbsp;in the forum:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Y_simulated = rand('BERNOULLI', 1-pzero)*rand('NEGBINOMIAL', k, p);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can use the pzero = zero inflation probability parameter generated from proc genmod.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, proc genmod does not produce the parameters k (= # of successes) and p (probability of success) which are necessary in the rand('NEGBINOMIAL', k, p) function. Can k and p be manually calculated from the proc genmod output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jan 2022 13:25:39 GMT</pubDate>
    <dc:creator>RobertWF1</dc:creator>
    <dc:date>2022-01-10T13:25:39Z</dc:date>
    <item>
      <title>How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789248#M38698</link>
      <description>&lt;P&gt;I've recently fit a&amp;nbsp;zero-inflated negative binomial distribution to hospital inpatient visit data using proc genmod:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc genmod data = IP_count_data;
  	model Y = / dist=zinb;
  	zeromodel;
	output out=ZINBFit p=p pzero=pzero;
	ods output ZeroParameterEstimates = ZeroParameterEstimates; 
	ods output ParameterEstimates = ParameterEstimates;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'd like to randomly generate observations Y from this same zero-inflated negative binomial distribution. This can be done using the following expression, pulled from an&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Random-generation-from-the-Zero-Modified-Negative-Binomial-dist/td-p/95511" target="_self"&gt;earlier question&lt;/A&gt;&amp;nbsp;in the forum:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Y_simulated = rand('BERNOULLI', 1-pzero)*rand('NEGBINOMIAL', k, p);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I can use the pzero = zero inflation probability parameter generated from proc genmod.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, proc genmod does not produce the parameters k (= # of successes) and p (probability of success) which are necessary in the rand('NEGBINOMIAL', k, p) function. Can k and p be manually calculated from the proc genmod output?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 13:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789248#M38698</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-01-10T13:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789254#M38699</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;might know how to do this.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 14:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789254#M38699</guid>
      <dc:creator>WeiChen</dc:creator>
      <dc:date>2022-01-10T14:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789257#M38700</link>
      <description>Maybe I should repost my question in the Statistical Procedures forum?  &lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures" target="_blank"&gt;https://communities.sas.com/t5/Statistical-Procedures/bd-p/statistical_procedures&lt;/A&gt;</description>
      <pubDate>Mon, 10 Jan 2022 14:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789257#M38700</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-01-10T14:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789287#M38701</link>
      <description>&lt;P&gt;See &lt;A href="http://support.sas.com/kb/24166" target="_self"&gt;this note&lt;/A&gt; that shows how to estimate distribution parameters for use in DATA step functions, including the negative binomial.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jan 2022 16:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789287#M38701</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2022-01-10T16:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate Y from zero-inflated negative binomial dbn fit with proc genmod?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789370#M38705</link>
      <description>Fantastic, thank you!</description>
      <pubDate>Mon, 10 Jan 2022 22:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-randomly-generate-Y-from-zero-inflated-negative-binomial/m-p/789370#M38705</guid>
      <dc:creator>RobertWF1</dc:creator>
      <dc:date>2022-01-10T22:38:37Z</dc:date>
    </item>
  </channel>
</rss>

