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


From   "Sun, Wensheng" <wsun@bcm.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: xtmixed
Date   Thu, 3 Jan 2013 18:06:08 -0600

Hi, William,

Thanks for the reply. For example, 

webuse pig

gen drug=.
replace drug=0 if id<=24
replace drug=1 if id>24
gen drug_week=drug*week
xtmixed weight week i.drug drug_week, ||id: week, covariance(unstructured) residuals(independent) mle variance

I want the independent variable 'week' to be random in coefficient and intercept, eg. each id has its own slope and overall, different drug group has different slope at each week. However, if I use the above command, when I run

margins drug, at(week=(1 5 9))
marginsplot

what I got is two straight lines with exactly the same slopes.

The marginsplot I wish to get is the ones in www.stata.com/stata12/margins-plots

Please help.

Thank you very much!

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