Bookmark and Share

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]

st: marginsplot after gllamm for a count model


From   Lloyd Dumont <lloyddumont@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: marginsplot after gllamm for a count model
Date   Tue, 18 Oct 2011 14:01:53 -0700 (PDT)

Hello.  I have just run a multilevel count model.  After considering the many options for including a random effect and dealing with overdispersion, I decided that gllamm was the best option.  The model appears to fit the data quite nicely.
 
But, it has been tricky generating a margins plot (or any plot of predicted counts).  There are two things about it that are tricky.  First, I am not sure how margins refers to the kind of prediction I want (fitted counts) or where to find the abbreviation for that value.  Second, the variable along the x-axis is the time trend, which is represented in the model by a linear variable and a quadratic one.  This would not be that much of a problem is gllamm allowed for the facilitated inclusion of interactions/factor variables, but I don’t think it does.
 
So, here is a simplified version of the model…
 
generate cons = 1
eq ri: cons
 
gllamm DEP_COUNT TREND TREND_sq CONTROL, family(poisson) link(log) i(ID) eqs(ri) robust adapt
margins, at(LINTREND=(0(1)5))
 
The end result of this is straight-line increasing function with all values below 0.  Really, it should be a curvilinear increasing function with values ranging from about .9 up to 3 or so.
 
Thank you for your help!  Lloyd Dumont

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index