|From||David Airey <email@example.com>|
|Subject||st: intraclass correlations|
|Date||Thu, 19 Feb 2004 10:31:29 -0600|
Here May has picked up MSE from the test of A. Should she not have picked up MSE immediately after the anova command via the ereturn list?
OK, now for two random factors. For these formulas I must turn to the
comprehensive experimental design text by Winer et. al. "Statistical
Principles of Experimental Design" (page 413). The formula is what you
would expect it to be: ICC=variance of A/(total variance). So again, we
count the number of repetitions, and this time the number of levels of
each factor, compute the variance components, and then ICC.
This time I am going to generate my own balanced dataset. Again, if your
design is not balanced, you just have to work harder to get the variance
components (the formulas for this are in Winer).
*----two random factors--------------*
*--- generate balanced data
set obs 36
replace A=1 if A==7
bysort A: generate B=int(_n/2+1)
replace B=1 if B==4
table `A' `B'
local p= sum
drop sum tag
local q= sum
drop sum tag
anova `depvar' `A' `B' `A'*`B'
test `B'Secondly, I came across a more general formula for the intraclass correlation in a text by Kirk:
Notice, we have to work a bit harder to get the mean squares for each of
the factors this time, since they are not in the saved results after
-anova-. But, that is where -test- comes in handy, because they are in
the results after -test-.