Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: Poisson and Negbin models


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: Poisson and Negbin models
Date   Mon, 29 Oct 2012 11:42:36 +0100

Sounds like an old version of -margdistfit-. You can try installing
the latest version by typing in Stata -ssc install margdistfit-. To
make sure that the appropriate Mata libraries are loaded you should
also either restart Stata or type -mata: mata mlib index-. This is
only an issue during the session in which you installed -margdistfit-.

-- Maarten

On Mon, Oct 29, 2012 at 11:02 AM, Simon Falck <[email protected]> wrote:
> Thanks Maarten.
>
> I have only used the tests to explore the distribution of the data, and see your point of them not being relevant.
>
> I have downloaded your "berlin12 example" on comparing distributions. Strangely, the -margdistfit- did not to work after any count model. I got this error message after -poisson-:
>
> . margdistfit, hangroot(susp notheor jitter(2)) name(poisson)
> margdistfit cannot be used after poisson
>
> I tried the other models (non count), for which -margdistfit- worked well.
>
> Can you think of why I cannot use -margdistfit- after count models? Is it because I am using Stata v. 11.2, and would need Stata 12.x?
>
> /Simon
>
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On Behalf Of Maarten Buis
> Sent: den 29 oktober 2012 10:17
> To: [email protected]
> Subject: Re: st: Poisson and Negbin models
>
>> The first indication is it that Y is overdispersed as the mean and the variance is not equal, nor close being equal (mean 4.347222 < var 542.6806). A formal Goodness-of-fit test of Y alone, using estat gof- after -poisson $y-, indicates Y is significantly different from a Poisson distribution (chi2 = 1726.882, Prob > chi2(71) = 0.0000). Similarly the LR test of alpha related to the output from -nbreg $y- indicates that the negbin model is preferred over the Poisson (LR=0:  chibar2(01) = 1570.16 Prob>=chibar2 = 0.000).
>
> Those are not appropriate tests as you would not expect the marginal distribution of y to Poisson or negative binomially distribution, otherwise you would not have added the explanatory variables later on... See e.g. <http://www.maartenbuis.nl/presentations/berlin12.html>
>
>> When I run the model Y=X1 X2...Xn, using the -nbreg- command, I end up with some problems. The model outcome indicates some problem with the alpha, and a LR test indicating that the Poission is preferred over the negbin model:
> <snip>
>> -------------+--------------------------------------------------------
>> -------------+--------
>>     /lnalpha |  -18.90698   558.4214       113.393    1075.579
>> -------------+--------------------------------------------------------
>> -------------+--------
>>        alpha |   6.15e-09   3.43e-06                             0           .
>> ----------------------------------------------------------------------
>> -------- I would appreciate if someone could explain what seems to be
>> the problem(s) here, and some indication on the problem related to the alpha in the negbin model.
>
> A Poisson model is a negative binomial model with an alpha of 0. In your case the alpha is 0.000000000615 (if I counted the 0s correctly).
> So to all intends and purposes you estimated a Poisson model with -nbreg-.
>
> -- Maarten
>
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/



-- 
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index