Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: RE: RE: more on_statsby error |
Date | Wed, 22 Sep 2010 13:13:36 -0500 |
Martin - You're right - interesting discovery - thanks! . statsby _b[ib] _se[ib],by(condition outcome): xtmixed (y ib ) (isub: R.ib,cov(exchangeable) ) (fd: R.ib,cov(exchangeable) nolog iter(20)) (running xtmixed on estimation sample) command: xtmixed (y ib) (isub: R.ib, cov(exchangeable)) (fd: R.ib, cov(exchangeable) nolog iter(20)) _stat_1: _b[ib] _stat_2: _se[ib] by: condition outcome Statsby groups ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 .................................................. 50 ............................... Al -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss Sent: Wednesday, September 22, 2010 11:57 AM To: statalist@hsphsun2.harvard.edu Subject: st: RE: more on_statsby error <> But note that you can delimit the parts with round parantheses and make things work: *********** webuse productivity, clear preserve statsby _b[private],by(region): xtmixed (gsp private, noconst) (region:) (state:, mle cov(exchangeable) nolog) li restore statsby _b[private],by(region): xtmixed gsp private, noconst || region: || state:, mle cov(exchangeable) nolog *********** HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Feiveson, Alan H. (JSC-SK311) Sent: Mittwoch, 22. September 2010 17:33 To: statalist@hsphsun2.harvard.edu Subject: st: more on_statsby error Apparently, in an -xtmixed_ command with more than one level, -statsby- can only handle options in the fixed or random sections if such options occur only once in the whole model: option in the fixed part ony: . statsby _b[ib],by(condition outcome) : xtmixed y ib, noconst ||isub: ib ||fd: R.ib (running xtmixed on estimation sample) command: xtmixed (y ib, noconst) (isub: ib) (fd: R.ib) _stat_1: _b[ib] by: condition outcome Statsby groups ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 [works] option in the first random level only: . statsby _b[ib],by(condition outcome) : xtmixed y ib ||isub: ib,noconst ||fd: R.ib (running xtmixed on estimation sample) command: xtmixed (y ib) (isub: ib, noconst) (fd: R.ib) _stat_1: _b[ib] by: condition outcome Statsby groups ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 [works] option in the second random level only: . statsby _b[ib],by(condition outcome) : xtmixed y ib ||isub: ib ||fd: R.ib, noconst (running xtmixed on estimation sample) command: xtmixed (y ib) (isub: ib) (fd: R.ib, noconst) _stat_1: _b[ib] by: condition outcome Statsby groups ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 ......... [works] One option in the fixed part and one option in the first random level: . statsby _b[ib],by(condition outcome) : xtmixed y ib, noconst ||isub: ib,noconst ||fd: R.ib invalid 'noconst' r(198); In general, -statsby- will fail if there is more than one option section anywhere in the model. Al Feiveson * * 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/ * * 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/ * * 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/