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: -anova- command fails with mildly complexx model


From   "Feiveson, Alan H. (JSC-SK311)" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: -anova- command fails with mildly complexx model
Date   Thu, 15 Apr 2010 16:15:04 -0500

Hello - I have Stata 11 IC running on Windows XP. When I try to run -anova- on the data set I have listed at the end of this message, bad things happen. Please see below. I would welcome any suggestions or explanations.

Al Feiveson


My factors are:
group (2 levels)
treat(2 levels)
isub (30 levels - nested within group # treat)
time (4 levels, repeated for each isub)

y is the dependent variable


First I run this in "non-repeated" syntax without the group#treat interaction. It works.

. use anovatest_041410
. anova y  treat group / isub|treat#group    time time#(group##treat)

                           Number of obs =     120     R-squared     =  0.9518
                           Root MSE      = .504486     Adj R-squared =  0.9265

                  Source |  Partial SS    df       MS           F     Prob > F
        -----------------+----------------------------------------------------
                   Model |  392.423133    41  9.57129592      37.61     0.0000
                         |
                   treat |  145.674315     1  145.674315      30.65     0.0000
                   group |   100.00584     1   100.00584      21.04     0.0001
        isub|treat#group |   128.34615    27  4.75356109
        -----------------+----------------------------------------------------
                    time |  .899050531     3   .29968351       1.18     0.3238
              time#group |  .008263434     3  .002754478       0.01     0.9984
              time#treat |  1.06352637     3  .354508791       1.39     0.2512
        time#group#treat |  .768763895     3  .256254632       1.01     0.3943
                         |
                Residual |  19.8514669    78  .254505985
        -----------------+----------------------------------------------------
                   Total |    412.2746   119  3.46449243

Now I try to add the group#treat interaction term:

anova y  treat group treat#group / isub|treat#group    time time#(group##treat)

[stuck in infinite loop]

close out Stata, bring it up and try again with the interaction term:


use anovatest_041410
anova y  treat group treat#group / isub|treat#group    time time#(group##treat)

[crashed] The instruction at "x7c911129"refrenced memory at "0x031faad5". The memory could not be "read".

close out Stata, bring it up and try again without the "time" part of the model. It works.


use anovatest_041410
. anova y  treat group treat#group / isub|treat#group

                           Number of obs =     120     R-squared     =  0.9451
                           Root MSE      = .501472     Adj R-squared =  0.9274

                  Source |  Partial SS    df       MS           F     Prob > F
        -----------------+----------------------------------------------------
                   Model |  389.641905    29  13.4359278      53.43     0.0000
                         |
                   treat |   148.76034     1   148.76034      31.22     0.0000
                   group |  100.899184     1  100.899184      21.18     0.0001
             treat#group |  20.7962645     1  20.7962645       4.36     0.0466
        isub|treat#group |  123.880297    26  4.76462679
        -----------------+----------------------------------------------------
                         |
                Residual |  22.6326945    90  .251474384
        -----------------+----------------------------------------------------
                   Total |    412.2746   119  3.46449243

Now add the "time" part back in:

anova y  treat group treat#group / isub|treat#group    time time#(group##treat)

[crashed] The instruction at "0x00727e9e"refrenced memory at "0x00000000". The memory could not be "read".

Bring up Stata and try again. This time it ran, but the factors are all messed up. Note that there is no treat#group factor in the anova table, and that "time" appears in the upper part where it doesn't belong. Also no treat#group interaction.



use anovatest_041410
. anova y  treat##group / isub|treat#group  time time#(group##treat)

                           Number of obs =     120     R-squared     =  0.9518
                           Root MSE      = .504486     Adj R-squared =  0.9265

                  Source |  Partial SS    df       MS           F     Prob > F
        -----------------+----------------------------------------------------
                   Model |  392.423133    41  9.57129592      37.61     0.0000
                         |
                   treat |  145.674315     1  145.674315      30.65     0.0000
                   group |   100.00584     1   100.00584      21.04     0.0001
              time#group |  .008263434     3  .002754478       0.00     1.0000
        isub|treat#group |   128.34615    27  4.75356109
        -----------------+----------------------------------------------------
                    time |  .899050531     3   .29968351       1.18     0.3238
              time#treat |  1.06352637     3  .354508791       1.39     0.2512
        time#treat#group |  .768763895     3  .256254632       1.01     0.3943
                         |
                Residual |  19.8514669    78  .254505985
        -----------------+----------------------------------------------------
                   Total |    412.2746   119  3.46449243

Now try it with the -repeated- option. First without the treat#group interaction. It works.


. anova y  treat group / isub|treat#group    time time#(group##treat) ,repeated(time)

                           Number of obs =     120     R-squared     =  0.9518
                           Root MSE      = .504486     Adj R-squared =  0.9265

                  Source |  Partial SS    df       MS           F     Prob > F
        -----------------+----------------------------------------------------
                   Model |  392.423133    41  9.57129592      37.61     0.0000
                         |
                   treat |  145.674315     1  145.674315      30.65     0.0000
                   group |   100.00584     1   100.00584      21.04     0.0001
        isub|treat#group |   128.34615    27  4.75356109
        -----------------+----------------------------------------------------
                    time |  .899050531     3   .29968351       1.18     0.3238
              time#group |  .008263434     3  .002754478       0.01     0.9984
              time#treat |  1.06352637     3  .354508791       1.39     0.2512
        time#group#treat |  .768763895     3  .256254632       1.01     0.3943
                         |
                Residual |  19.8514669    78  .254505985
        -----------------+----------------------------------------------------
                   Total |    412.2746   119  3.46449243


Between-subjects error term:  isub|treat#group
                     Levels:  30        (27 df)
     Lowest b.s.e. variable:  isub
     Covariance pooled over:  treat#group  (for repeated variable)

Repeated variable: time
                                          Huynh-Feldt epsilon        =  1.0920
                                          *Huynh-Feldt epsilon reset to 1.0000
                                          Greenhouse-Geisser epsilon =  0.9061
                                          Box's conservative epsilon =  0.3333

                                            ------------ Prob > F ------------
                  Source |     df      F    Regular    H-F      G-G      Box
        -----------------+----------------------------------------------------
                    time |      3     1.18   0.3238   0.3238   0.3225   0.2878
              time#group |      3     0.01   0.9984   0.9984   0.9973   0.9179
              time#treat |      3     1.39   0.2512   0.2512   0.2535   0.2486
        time#group#treat |      3     1.01   0.3943   0.3943   0.3894   0.3249
                Residual |     78
        ----------------------------------------------------------------------

Now try again with the treat#group interaction added. This time it thinks "time" is the error term for the first part and various other terms are missing.



. anova y  treat##group / isub|treat#group    time time#(group##treat) ,repeated(time)

                           Number of obs =     120     R-squared     =  0.9518
                           Root MSE      = .504486     Adj R-squared =  0.9265

                  Source |  Partial SS    df       MS           F     Prob > F
        -----------------+----------------------------------------------------
                   Model |  392.423133    41  9.57129592      37.61     0.0000
                         |
                   treat |  145.674315     1  145.674315     486.09     0.0002
                   group |   100.00584     1   100.00584     333.70     0.0004
        isub|treat#group |  130.023122    27  4.81567118      16.07     0.0207
                    time |  .899050531     3   .29968351
        -----------------+----------------------------------------------------
              time#treat |  1.06352637     3  .354508791       1.39     0.2512
        time#treat#group |   .78408852     6   .13068142       0.51     0.7964
                         |
                Residual |  19.8514669    78  .254505985
        -----------------+----------------------------------------------------
                   Total |    412.2746   119  3.46449243


Between-subjects error term:  isub|treat#group
                     Levels:  30        (27 df)
     Lowest b.s.e. variable:  isub
     Covariance pooled over:  treat#group  (for repeated variable)

Repeated variable: time
                                          Huynh-Feldt epsilon        =  1.0920
                                          *Huynh-Feldt epsilon reset to 1.0000
                                          Greenhouse-Geisser epsilon =  0.9061
                                          Box's conservative epsilon =  0.3333

                                            ------------ Prob > F ------------
                  Source |     df      F    Regular    H-F      G-G      Box
        -----------------+----------------------------------------------------
              time#treat |      3     1.39   0.2512   0.2512   0.2535   0.2486
        time#treat#group |      6     0.51   0.7964   0.7964   0.7796   0.6044
                Residual |     78
        ----------------------------------------------------------------------



Data:
    isub   treat   group   time           y
       1       0       0      1    3.128386
       1       0       0      2    3.121638
       1       0       0      3    2.875379
       1       0       0      4    2.561247
       2       0       0      1    1.007731
       2       0       0      2    1.717744
       2       0       0      3    2.074634
       2       0       0      4    2.258288
       3       0       0      1    3.533892
       3       0       0      2    3.605727
       3       0       0      3    2.435609
       3       0       0      4    2.814991
       4       0       0      1     .165792
       4       0       0      2     1.45446
       4       0       0      3    .0822014
       4       0       0      4    1.636633
       5       0       0      1    1.549338
       5       0       0      2    1.182068
       5       0       0      3    1.227366
       5       0       0      4    .7778459
       6       0       0      1    1.173828
       6       0       0      2    .8148147
       6       0       0      3    1.368575
       6       0       0      4   -.0073038
       7       0       0      1    3.100238
       7       0       0      2    2.073025
       7       0       0      3    2.476525
       7       0       0      4    2.520768
       8       0       0      1    2.807955
       8       0       0      2    2.805253
       8       0       0      3    2.153584
       8       0       0      4      2.5705
       9       0       0      1    2.704864
       9       0       0      2    2.654852
       9       0       0      3    2.746811
       9       0       0      4     2.94425
      10       0       0      1      1.6997
      10       0       0      2    1.810207
      10       0       0      3     1.55903
      10       0       0      4    1.669906
      11       1       0      1    1.868059
      11       1       0      2    3.322237
      11       1       0      3      3.7292
      11       1       0      4    3.670806
      12       1       0      1    2.434988
      12       1       0      2    3.323258
      12       1       0      3    3.372895
      12       1       0      4    3.338208
      13       1       0      1     1.22023
      13       1       0      2    .7378999
      13       1       0      3    .5126179
      13       1       0      4     1.54094
      14       1       0      1    4.453463
      14       1       0      2     4.22743
      14       1       0      3    5.309576
      14       1       0      4    5.050639
      15       1       0      1    4.416439
      15       1       0      2    3.452432
      15       1       0      3    4.392283
      15       1       0      4    4.605953
      16       1       0      1    5.449149
      16       1       0      2    4.524527
      16       1       0      3    4.718941
      16       1       0      4    4.981455
      17       1       0      1     2.48961
      17       1       0      2    3.723629
      17       1       0      3    2.284816
      17       1       0      4    3.453557
      18       1       0      1    3.641483
      18       1       0      2    3.406856
      18       1       0      3    3.208734
      18       1       0      4     3.80458
      19       0       1      1     3.37035
      19       0       1      2     3.97767
      19       0       1      3    3.014043
      19       0       1      4    3.020998
      20       0       1      1    1.288446
      20       0       1      2    1.037267
      20       0       1      3    1.188551
      20       0       1      4    1.292643
      21       0       1      1    3.397913
      21       0       1      2    3.811652
      21       0       1      3    3.757371
      21       0       1      4    3.876024
      22       0       1      1    3.147866
      22       0       1      2    3.404653
      22       0       1      3    3.840606
      22       0       1      4    3.757992
      23       0       1      1    4.017531
      23       0       1      2     4.78287
      23       0       1      3    4.696186
      23       0       1      4    3.947599
      24       0       1      1    2.150811
      24       0       1      2    1.366459
      24       0       1      3    2.619952
      24       0       1      4    2.440276
      25       1       1      1     3.84514
      25       1       1      2    4.948975
      25       1       1      3    4.019058
      25       1       1      4    5.542306
      26       1       1      1    7.858982
      26       1       1      2    7.427705
      26       1       1      3    7.378307
      26       1       1      4    8.286385
      27       1       1      1    5.736018
      27       1       1      2    7.030629
      27       1       1      3    6.816757
      27       1       1      4    7.087567
      28       1       1      1    5.363531
      28       1       1      2    4.517203
      28       1       1      3    4.877666
      28       1       1      4     5.66123
      29       1       1      1    6.778078
      29       1       1      2    6.779854
      29       1       1      3    6.729872
      29       1       1      4    5.738735
      30       1       1      1    7.368432
      30       1       1      2    6.341629
      30       1       1      3     5.96716
      30       1       1      4    6.480004

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