Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
jhilbe@aol.com |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: RE: synthetic ZINB |

Date |
Sun, 5 Jun 2011 19:31:50 -0400 (EDT) |

Statalisters:

Best, Joseph Hilbe ZINB_SYN.DO ================================================== * Zero inflated Negative binomial with logit as binary component * Joseph Hilbe 5Jun2011 zinb_syn.do * LOGIT: x1=-.9, x2=-.1, _c=-.2 * NB2 : x1=.75, n2=-1.25, _c=2, alpha=.5 clear set obs 50000 set seed 1000 gen x1 = invnorm(runiform()) gen x2 = invnorm(runiform()) * NEGATIVE BINOMIAL- NB2 gen xb = 2 + 0.75*x1 - 1.25*x2 gen a = .5 gen ia = 1/a gen exb = exp(xb) gen xg = rgamma(ia, a) gen xbg = exb * xg gen nby = rpoisson(xbg) * BERNOULLI gen pi =1/(1+exp(-(.9*x1 + .1*x2+.2))) gen bernoulli = runiform()>pi gen zy = bernoulli*nby rename zy y * NB2-LOGIT HURDLE zinb y x1 x2, inf(x1 x2) nolog =================================

------------------------------------------------------------------------- -----

-------------+----------------------------------------------------------- ----- y |

-------------+----------------------------------------------------------- ----- inflate |

-------------+----------------------------------------------------------- -----

-------------+----------------------------------------------------------- -----

------------------------------------------------------------------------- -----

**Attachment:
zinb_syn.do**

**Follow-Ups**:**st: RE: synthetic ZINB***From:*jhilbe@aol.com

- Prev by Date:
**Re: st: browse in stata 11 - order of variables** - Next by Date:
**st: RE: synthetic ZINB** - Previous by thread:
**st: on GLLAMM and geqs** - Next by thread:
**st: RE: synthetic ZINB** - Index(es):