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: -intgph nbreg- drops interaction variables


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   RE: st: -intgph nbreg- drops interaction variables
Date   Mon, 14 Mar 2011 17:05:26 +0000

I can't see that you have given evidence of an error.  

-nbreg- expects a count variable. The help says "-nbreg- fits a negative binomial regression model of depvar on indepvars, where depvar is a nonnegative count variable." 
So, you need say nothing. If your depvar is not a count variable, but is still non-negative, -nbreg- warns you to take responsibility.   

That is, however, a secondary point so far as I can tell. 

I don't think it follows that because a -poisson- model allows interactions, then necessarily -nbreg- with the same data will too.  

As many other threads show, Stata often drops (meaning, omits) variables from models. This is deliberate and indeed a feature. The fix is not to try to force them back in. The fix is to find a better model for your data (or, for some purposes, better data for your model). 

Nick 
[email protected] 

Müller Barbara

Thanks for your answer. Yes, my question is a proxy for another one involving my own data. I just replicated the error with the sample data so it would be possible for other users to replicate it. I'm not trying to compare the models, I used the -intgph- with the -poisson- model to check whether something was wrong with my command. 
Are you implying that I need to tell Stata that my dependent is a count variable? How would I do that?

Nick Cox 

-tenure- is a measured variable and while that does not rule out
modelling with -poisson- it does seem to make application of -nbreg-
strange at best and nonsensical at worst.

That aside, I read your message as implying that one model is a poor
match for the data you throw at it and another a rather better one.
That would not seem to imply any problem with either -nbreg- or
-intgph-.

Is this question a proxy for another one involving your own data?

2011/3/14 Müller  Barbara <[email protected]>:

> When I use the -intgph- command (from SSC-Archives) with a -nbreg- model, I get the message that my interaction variables were dropped. The analysis can be reproduced with the nlsw88 example Stata-dataset. This is the code I used:
> webuse nlsw88
> intgph nbreg tenure, ivars (age south)
>
> It returns this error message:
> ageXsouth  has been dropped by nbreg
> ageXsouth is the product of the interaction vars
> r(499);
>
> If I use the same command with a -poisson- model, the model runs fine:
> intgph poisson tenure, ivars (age south)
>
> My Stata version and ado-files are up to date.

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


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