Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | rgutierrez@stata.com (Roberto G. Gutierrez, StataCorp) |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: xtmixed with option residuals |
Date | Mon, 11 Oct 2010 12:46:21 -0500 |
Lisa Schoeler <lschoeler@wiwi.uni-frankfurt.de> asks: > .xtmixed q0 number_brands market_share intensity satisfaction channels > margin sga0 rd0 cogs0 lppe0 income0 lassets0 leverage0 ||SIC_twodigits: > number_brands market_share intensity satisfaction channels margin, mle > residuals(ar 1, by(id) t(year)) > And I get the following error: > option residuals(): by variable is not constant within lowest-level panels > r(459); > I don't understand why I get this error. I have a dataset that includes 9 > yearly observations for different companies(unique id for each company) that > are in different SICs. Can anyone tell me where my problem is? My guess is that Lisa wants an autoregressive structure within the groups defined by variable -id-, summarized by one AR parameter. If this is the case, then instead of specifying the residual structure "by(id)", Lisa should define a new (empty) lowest level on the -id- variable: xtmixed q0 number_brands market_share intensity satisfaction /// channels margin sga0 rd0 cogs0 lppe0 income0 lassets0 /// leverage0 || SIC_twodigits: number_brands market_share /// intensity satisfaction channels margin || id:, nocons /// mle residuals(ar 1, t(year)) When you use -by()- within -residuals()-, you are estimating a set of parameters for each group of the by variable, which is probably not what Lisa wants. --Bobby rgutierrez@stata.com * * 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/