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 |
"E. Paul Wileyto" <epw@mail.med.upenn.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: simulating random numbers from zero inflated negative binomial estimates |

Date |
Thu, 02 Jun 2011 10:56:50 -0400 |

I'm not sure whether anyone has answered this yet.

predict p1, pr

The second predicted quantity you will need is: predict lp, xb

predict alpha, xb eq(#3)

Here's my script: zinb cignums drug week, inf(drug week) predict p1 , pr predict p2 , xb predict lnalpha , xb eq(#3) gen alph=exp(lnalpha) gen xg=rgamma(1/alph, alph*p2) gen pg=rpoisson(xg) gen zi=runiform()>p1 gen newcigs=zi*pg zinb newcigs drug week, inf(drug week) Paul On 6/1/2011 7:13 PM, Ari Samaranayaka wrote:

Deaf statalist membersCan some one help me with this question with regards to zero-inflatednegative binomial regression (ZINB command) . I need to see how goodthe fitted model by comparing model outputs with observations. Forthis, I aim to simulate random numbers from fitted model to comparewith observed numbers.Can some one tell me how to simulate random numbers from the fittedmodel please? Is there any post estimation command for this? if not,is it possible to use estimated regression coefficients?Thank you Ari-Sam * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

-- E. Paul Wileyto, Ph.D. Senior Research Investigator, Department of Biostatistics& Epidemiology Director of Biostatistics, Tobacco Use Research Center School of Medicine, U. of Pennsylvania 3535 Market Street, Suite 4100 Philadelphia, PA 19104-3309 215-746-7147 Fax: 215-746-7140 epw@upenn.edu * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: simulating random numbers from zero inflated negative binomial estimates***From:*Ari Samaranayaka <ari.samaranayaka@ipru.otago.ac.nz>

**References**:**st: simulating random numbers from zero inflated negative binomial estimates***From:*Ari Samaranayaka <ari.samaranayaka@ipru.otago.ac.nz>

- Prev by Date:
**st: opreg without exit variable** - Next by Date:
**Re: st: SMCL {stata args[:txt]}** - Previous by thread:
**st: simulating random numbers from zero inflated negative binomial estimates** - Next by thread:
**Re: st: simulating random numbers from zero inflated negative binomial estimates** - Index(es):