Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, 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 |
Fri, 03 Jun 2011 10:27:57 -0400 |

zinb cignums drug week, inf(drug week) predict p1 , pr predict p2 , xb predict lnalpha , xb eq(#3) gen alph=exp(lnalpha) This next part simulates the data and should be repeated many times. 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)

P On 6/3/2011 1:03 AM, Ari Samaranayaka wrote:

Dear PaulThank you very much for the great help. Your are the first person toanswer my question. Your answer works, and I understood the logic youused in your codes. Simulated random variates goes quite closely withobserved data. I interpret this as a reasonable model fit. Great.Thank you.I expected whenever the ZINB model fit is reasonably good, if we usethe ZINB postestimation predict command to produce predicted numbers,those predicted numbers also should goes closely with observed data.For example, if I use the command predict expec, irthen distribution of resultant values in "expec" should have similardistribution to observed data (because we do not specify an "exposure"in our model). However those 2 distributions quite different. Did Imisinterpret the result from predict command.Thank you again Ari

-- 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>

**Re: st: simulating random numbers from zero inflated negative binomial estimates***From:*"E. Paul Wileyto" <epw@mail.med.upenn.edu>

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

- Prev by Date:
**Re: st: Constrained Regression in Stata** - Next by Date:
**st: Looping or macro needed??? - Followup question** - Previous by thread:
**Re: 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):