# [R] How to get Greenhouse-Geisser epsilons from anova?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Dec 9 21:26:45 CET 2008

```Skotara wrote:
> Dear John and Peter,
>
> thank you both very much for your help!
> Everything works fine now!
>
> John, Anova also works very fine. Thank you very much!
> However, if I had more than 2 levels for the between factor the same
> thing as mentioned occured.
> The degrees of freedom showed that Anova calculated it as if all
> subjects came from the same group, for example for main effect A the dfs
> are 1 and 35.
> Since I can get those values using anova that causes no problem.
>
> I saw that the x\$G to get the greenhouse-geisser epsilon do work for:
> x<- anova(mlmfitD, X=~C+B, M=~A+C+B, test = "Spherical")
> but does not work for y\$G:
> y <- anova(mlmfit, mlmfit0, X= ~C+B, M = ~A+C+B, idata =
> dd,test="Spherical")

Do yourself a favour and check what the actual names are:

foo\$"G-G Pr"

works in both forms. Notice that these are the epsilon-corrected
p-values, and not the epsilons themselves.

>
> Finally, the Greenhouse-Geisser epsilons are identical using both
> methods and to the SPSS output.
> The Huynh-Feldt are not the same as them of SPSS. I will use GG instead.

If they differ by a factor of N/(f+1) where f is the number of df for
the SSD matrix (alias N-k if all you have is a grouping into k groups),
then SPSS has the same bug as SAS. (This is also mentioned in the R news
paper).

--
O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

```