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

re: st: -xtmixed- and random terms nested within fixed treatment terms?


From   David Airey <david.airey@vanderbilt.edu>
To   statalist@hsphsun2.harvard.edu
Subject   re: st: -xtmixed- and random terms nested within fixed treatment terms?
Date   Thu, 16 Jun 2005 11:32:24 -0500

.

You said:

Suppose I have subjects assigned to treatment with outcomes measured at repeated occasions, and a covariate.
This design is a simple one between one within split-plot with a covariate. If we ignore the covariate, the ANOVA design would be, from http://www.ats.ucla.edu/stat/stata/faq/xtmixed.htm:

/* spf-2.4 subjects nested in a */
/* between subjects: a */
/* within subjects: b */

use http://www.ats.ucla.edu/stat/stata/examples/kirk/spf2-4, clear

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

xi3 e.a*e.b

xtmixed y _Ia_2 _Ib_2 _Ib_3 _Ib_4 _Ia2Xb2 _Ia2Xb3 _Ia2Xb4 || s:

test _Ia_2

test _Ib_2 _Ib_3 _Ib_4

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

test _Ia2Xb2 _Ia2Xb3 _Ia2Xb4

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