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: RE: RE: more on_statsby error


From   "Feiveson, Alan H. (JSC-SK311)" <[email protected]>
To   "[email protected]" <[email protected]>
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: [email protected] [mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Wednesday, September 22, 2010 11:57 AM
To: [email protected]
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: [email protected]
[mailto:[email protected]] On Behalf Of Feiveson, Alan H.
(JSC-SK311)
Sent: Mittwoch, 22. September 2010 17:33
To: [email protected]
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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index