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]

st: marginsplot after gllamm for a count model


From   Lloyd Dumont <[email protected]>
To   "[email protected]" <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index