Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: re: ANOVA model (my mistake)


From   khigbee@stata.com
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: re: ANOVA model (my mistake)
Date   Mon, 30 Sep 2002 15:44:14 -0500

In relation to the discussion started by David Airey
<david.airey@vanderbilt.edu> I had pointed out that it did not
matter if you used a numbering scheme such as

    A  1 1 1 2 2 2
    B  1 2 3 1 2 3

or 

    A  1 1 1 2 2 2
    B  1 2 3 4 5 6

when dealing with B nested in A (written B|A in -anova- syntax).
I pointed to the discussion of this on page 64 of "[R] anova".

David Airey <david.airey@vanderbilt.edu> then presents two data
sets with different labeling for the nested term and shows that
they produce different results.

Let me point out the misunderstanding between what I was saying
and the two datasets presented by David.  David's first dataset
looks like:

          neuron   subject  treatm~t    measure
      1.        1         1         1   1.232982
      2.        2         1         1   1.166421
      3.        3         1         1   1.674022
      4.        1         1         2   1.690412
      5.        2         1         2   1.079583
      6.        3         1         2   1.983932
      7.        1         1         3  -1.573235
      8.        2         1         3   2.714028
      9.        3         1         3       3.24
     10.        1         1         4   1.470877
     11.        2         1         4   4.342456
     12.        3         1         4   .1263056
     13.        1         1         5   3.049922
     14.        2         1         5   2.537046
     15.        3         1         5  -.7629604
     16.        1         2         1  -1.013575
     17.        2         2         1   .6785818
     18.        3         2         1  -1.619054
     19.        1         2         2   1.396539
     20.        2         2         2   .9016123
     21.        3         2         2  -2.113595
     ...

and his second looks like:

           neuron   subject  treatm~t    measure
      1.        1         1         1   3.588527
      2.        2         1         1   2.431523
      3.        3         1         1   1.267083
      4.        4         1         2   2.137298
      5.        5         1         2   1.644081
      6.        6         1         2   4.000641
      7.        7         1         3   2.452223
      8.        8         1         3   2.811015
      9.        9         1         3    2.97793
     10.       10         1         4   1.751251
     11.       11         1         4   3.431399
     12.       12         1         4   .4201414
     13.       13         1         5   1.742686
     14.       14         1         5   .4739965
     15.       15         1         5   1.596641
     16.       16         2         1  -.9146303
     17.       17         2         1  -.5972514
     18.       18         2         1  -1.519495
     19.       19         2         2  -.6959237
     20.       20         2         2  -.3078359
     21.       21         2         2  -.5360426
     ...

His anova model is:

    anova measure subject / neuron|subject ...

where I put ... so that we can focus on the first part of the
syntax that is the important part for this discussion.

It is not surprising that the 2 numbering schemes shown by David
are not producing the same results.  If you look at my little
numbering scheme example

    A  1 1 1 2 2 2
    B  1 2 3 1 2 3

versus

    A  1 1 1 2 2 2
    B  1 2 3 4 5 6

which I claim will produce the same results for B|A, you will
notice that in the first case the numbering for B is 1 to n
within each level of A.  The first dataset that David presents
has neuron with 1 to 3 repeated many times for the SAME subject.
If his numbering scheme for neuron went from 1 to 15 within each
subject, then it would produce the same results as his second
data set.

I hope this clarifies the point I was trying to make about
numbering schemes for nested ANOVA models.  If not, please email
me and I will gladly discuss it with you.


Ken Higbee    khigbee@stata.com
StataCorp     1-800-STATAPC

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index