Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: problem with _statsby_


From   "Feiveson, Alan H. (JSC-SK311)" <alan.h.feiveson@nasa.gov>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: problem with _statsby_
Date   Wed, 22 Sep 2010 09:54:55 -0500

Hi - I am trying to run a complicated -xtmixed_ command with -statsby-, but it appears that _statsby_ doesn't like the "cov(exchangeable)" option.

Contains data from braslet_long_092110.dta
  obs:        19,197                          
 vars:            11                          22 Sep 2010 09:41
 size:       575,910 (99.4% of memory free)
----------------------------------------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
----------------------------------------------------------------------------------------------------------------
ord             float  %9.0g                  
outcome         byte   %9.0g                  group(meas)
sub             str1   %9s                    Astronaut
fd              int    %8.0g                  Time of Flight
braslet         str3   %9s                    Braslet
hrep            float  %9.0g                  session # (for y4 = HR only)
beatno          byte   %9.0g                  heartbeat #
condition       byte   %9.0g       cond       baseline, Valsava, or Mueller
y               float  %9.0g                  
ib              byte   %8.0g                  
isub            float  %9.0g                  group(sub)
---------------------------------------------------------------------------------------------------------Sorted by:  ord  outcome


Here- The -xtmixed- command works fine for one combination:


. xtmixed y ib if condition==1 & outcome==19 ||isub: R.ib,cov(exchangeable) ||fd: R.ib,cov(exchangeable) nolog

Mixed-effects REML regression                   Number of obs      =        84

-----------------------------------------------------------
                |   No. of       Observations per Group
 Group Variable |   Groups    Minimum    Average    Maximum
----------------+------------------------------------------
           isub |        8          6       10.5         12
             fd |       14          6        6.0          6
-----------------------------------------------------------

                                                Wald chi2(1)       =      8.34
Log restricted-likelihood = -341.96484          Prob > chi2        =    0.0039

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          ib |   24.11126   8.350805     2.89   0.004     7.743986    40.47854
       _cons |   176.8267   10.03752    17.62   0.000     157.1536    196.4999
------------------------------------------------------------------------------

------------------------------------------------------------------------------
  Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
isub: Exchangeable           |
                    sd(R.ib) |   24.10437   7.628245      12.96338    44.82014
                  corr(R.ib) |   .6203086   .3331783      -.323844    .9454376
-----------------------------+------------------------------------------------
fd: Exchangeable             |
                    sd(R.ib) |   18.48145   4.967922       10.9126    31.29998
                  corr(R.ib) |   .8079071   .1894934      .0514915    .9752792
-----------------------------+------------------------------------------------
                sd(Residual) |   9.483174   .8960756      7.879937     11.4126
------------------------------------------------------------------------------
LR test vs. linear regression:       chi2(4) =   116.96   Prob > chi2 = 0.0000


But when I try it with -statsby- , i get an error:


. statsby _b[ib],by(condition outcome): xtmixed y ib  ||isub: R.ib,cov(exchangeable) ||fd: R.ib,cov(exchangeable) nolog
invalid 'cov' 
r(198);


Yet, when I remove the "cov(exchangeable)" option, -statsby- works:


. statsby _b[ib],by(condition outcome): xtmixed y ib  ||isub: R.ib ||fd: R.ib, nolog
(running xtmixed on estimation sample)

      command:  xtmixed (y ib) (isub: R.ib) (fd: R.ib, nolog)
      _stat_1:  _b[ib]
           by:  condition outcome

Statsby groups
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
...............--Break--
r(1);

I guess I could do this by hand, but I wonder if anyone else has encountered similar problems with -statsby- .

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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index