[R] How to get Greenhouse-Geisser epsilons from anova?
Skotara
nils.skotara at uni-hamburg.de
Fri Dec 5 14:40:03 CET 2008
Dear Mr. Daalgard.
thank you very much for your reply, it helped me to progress a bit.
The following works fine:
dd <- expand.grid(C = 1:7, B= c("r", "l"), A= c("c", "f"))
myma <- as.matrix(myma) #myma is a 12 by 28 list
mlmfit <- lm(myma~1)
mlmfit0 <- update(mlmfit, ~0)
anova(mlmfit, mlmfit0, X= ~C+B, M = ~A+C+B, idata = dd,
test="Spherical"), which tests the main effect of A.
anova(mlmfit, mlmfit0, X= ~A+C, M = ~A+C+B, idata = dd,
test="Spherical"), which tests the main effect of B.
However, I can not figure out how this works for the other effects.
If I try:
anova(mlmfit, mlmfit0, X= ~A+B, M = ~A+C+B, idata = dd, test="Spherical")
I get:
Fehler in function (object, ..., test = c("Pillai", "Wilks",
"Hotelling-Lawley", :
residuals have rank 1 < 4
I also don't know how I can calculate the various interactions..
My read is I should change the second argument mlmfit0, too, but I can't
figure out how...
Do you know what to do?
Thank you very much!
Peter Dalgaard schrieb:
> Skotara wrote:
>> Dear all,
>>
>> I apologize for my basic question.
>> I try to calculate an anova for repeated measurements with 3 factors
>> (A,B,C) having 2, 2, and 7 levels.
>> or with an additional fourth between subjects factor D.
>> Everything works fine using
>> aov(val ~ A*B*C + Error(subject/ (A*B*C) ) ) or
>> aov(val ~ (D*A*B*C) + Error(subject/(A*B*C)) + D )
>> val, A, B, C, D and subject are columns in a data.frame.
>>
>> How can I get the estimated Greenhouse-Geisser and Huynh-Feldt epsilons?
>> I know Peter Dalgaard described it in R-News Vol. 7/2, October 2007.
>> However, unfortunately I am not able to apply that using my data...
>
> Why? It is supposed to work. You just need to work out the X and M
> specification for the relevant error strata and set test="Spherical"
> for anova.mlm, or work out the T contrast matrix explicitly if that
> suits your temper better.
>
>> Furthermore, I am still confused of how SPSS calculates the epsilons
>> since it is mentioned that perhaps there are any errors in SPSS??
>>
>> I would be glad if anyone could help me!
>> I am looking forward to hearing from you!
>>
>> Thank you!
>> Nils
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
More information about the R-help
mailing list