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

re: st: Specifying a repeated measures analysis in anova and xtmixed


From   David Airey <david.airey@vanderbilt.edu>
To   statalist@hsphsun2.harvard.edu
Subject   re: st: Specifying a repeated measures analysis in anova and xtmixed
Date   Tue, 2 Aug 2005 16:52:39 -0500

.

An answer to the discrepancy below is that one model assumes no interaction between subject and experimental factor while the other is more general and does.

Cheers,

-Dave




2) If I wanted to analyze this as a mixed model, what is an appropriate way to use xtmixed? I consider case and reader to be random effects, as both are drawn from larger populations of possible cases and readers. Likewise, I consider modality to be a fixed factor, as there are only N modalities of interest in any particular phase of my study. As such, I came up with the following as a rough guess of how to express it:


There seems a discrepancy between the randomized block factorial design anova solution given at UCLA and that given in the Stata FAQ. Unless the designs are different. I can't tell from the data table.

http://www.stata.com/support/faqs/stat/anova2.html#half713


--------------------------------------------------------------------
| 10 minute time periods and dial
| ------- 1 ------ ------- 2 ------ ------- 3 ------
subject | 1 2 3 1 2 3 1 2 3
---------- +---------------------------------------------------------
1 | 45 53 60 40 52 57 28 37 46
2 | 35 41 50 30 37 47 25 32 41
3 | 60 65 75 58 54 70 40 47 50
--------------------------------------------------------------------


. anova score subject period / subject*period dial / subject*dial period*dial, repeated(period dial)

or

. anova y s a / s*a b / s*b a*b, repeated(a b)

versus

http://www.ats.ucla.edu/stat/stata/faq/xtmixed.htm

----------+---------------------------------------------------------
| a and b
| ------- 1 ------ ------- 2 ------ ------- 3 ------
s | 1 2 3 1 2 3 1 2 3
----------+---------------------------------------------------------
1 | 37 43 48 39 35 46 31 41 64
2 | 42 44 47 30 40 36 21 50 52
3 | 33 36 29 34 31 45 20 39 53
4 | 29 27 38 26 22 27 18 36 42
5 | 24 25 28 21 27 26 10 34 49
----------+---------------------------------------------------------


/ ********************************************************************** ********************/
/ * */
/* randomized block factorial design */
/ * */
/* from kirk -- see http://www.ats.ucla.edu/stat/stata/examples/ kirk/kirkstata10.htm */
/ * */
/ ********************************************************************** ********************/

use http://www.ats.ucla.edu/stat/stata/examples/kirk/rbf33, clear

/* anova code: */ anova y s a b a*b, repeated(a b)

xi3 e.a*e.b

xtmixed y _Ia_2 _Ia_3 _Ib_2 _Ib_3 _Ia2Xb2 _Ia2Xb3 _Ia3Xb2 _Ia3Xb3 || s:

test _Ia_2 _Ia_3

/* scale chi^2 as F-ratio to compare with anova */
display r(chi2)/r(df)

test _Ib_2 _Ib_3

display r(chi2)/r(df)

test _Ia2Xb2 _Ia2Xb3 _Ia3Xb2 _Ia3Xb3

display r(chi2)/r(df)


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