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

re: st: ancova for repeated designs


From   David Airey <david.airey@vanderbilt.edu>
To   statalist@hsphsun2.harvard.edu
Subject   re: st: ancova for repeated designs
Date   Sat, 14 Aug 2004 22:25:19 -0500

That is annoying. You may have something in your data that Stata doesn't approve of that SPSS does. Maybe related to the features of this table:

. tab x g

| g
x | 1 2 3 | Total
-----------+---------------------------------+----------
1 | 6 3 0 | 9
3 | 3 0 0 | 3
5 | 0 3 3 | 6
6 | 3 0 3 | 6
-----------+---------------------------------+----------
Total | 12 6 6 | 24


What does this table look like in your full data set? X and y have only 6 integer values?

The model does run in Stata when I make up the data:

. clear

.
. set obs 30
obs was 0, now 30

. egen id = seq(), from(1) to(10) block(3)

. egen t = seq(), from(1) to(3) block(1)

. egen g = seq(), from(1) to(3) block(3)

. gen x = invnorm(uniform())

. gen y = invnorm(uniform())

.
. table id t, by(g) c(N y N x) concise

----------------------------
| t
g and id | 1 2 3
----------+-----------------
1 |
1 | 1 1 1
| 1 1 1
|
4 | 1 1 1
| 1 1 1
|
7 | 1 1 1
| 1 1 1
|
10 | 1 1 1
| 1 1 1
----------+-----------------
2 |
2 | 1 1 1
| 1 1 1
|
5 | 1 1 1
| 1 1 1
|
8 | 1 1 1
| 1 1 1
|
----------+-----------------
3 |
3 | 1 1 1
| 1 1 1
|
6 | 1 1 1
| 1 1 1
|
9 | 1 1 1
| 1 1 1
|
----------------------------

.
. anova y x g / id | g t g*t x*g, cont(x) rep(t)

Number of obs = 30 R-squared = 0.7092
Root MSE = 1.01388 Adj R-squared = 0.2333

Source | Partial SS df MS F Prob > F
-----------+----------------------------------------------------
Model | 27.573476 18 1.53185978 1.49 0.2525
|
x | .764235222 1 .764235222 0.61 0.4596
g | 3.09651697 2 1.54825848 1.24 0.3458
id|g | 8.7369122 7 1.24813031
-----------+----------------------------------------------------
t | 2.56959117 2 1.28479558 1.25 0.3242
g*t | 3.64710281 4 .911775703 0.89 0.5032
x*g | 2.84464804 2 1.42232402 1.38 0.2911
|
Residual | 11.307461 11 1.027951
-----------+----------------------------------------------------
Total | 38.880937 29 1.34072197


Between-subjects error term: id|g
Levels: 10 (7 df)
Lowest b.s.e. variable: id
Covariance pooled over: g (for repeated variable)

Repeated variable: t
Huynh-Feldt epsilon = 1.2243
*Huynh-Feldt epsilon reset to 1.0000
Greenhouse-Geisser epsilon = 0.7688
Box's conservative epsilon = 0.5000

------------ Prob > F ------------
Source | df F Regular H-F G-G Box
-----------+----------------------------------------------------
t | 2 1.25 0.3242 0.3242 0.3210 0.3100
g*t | 4 0.89 0.5032 0.5032 0.4883 0.4636
Residual | 11
-----------+----------------------------------------------------

.
.
end of do-file

.

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