[R] Huynh-Feldt R vs SAS Bug

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed May 4 22:36:06 CEST 2005

Bela Bauer <bela_b at gmx.net> writes:

> Hi,
> I'm using anova.mlm sphericity tests/corrections, and I'm getting
> different values than SAS. In order to be able to use these values for
> publications, I'd need to know more about the SAS bug that is
> mentioned in the Reference Manual.
> - What exactly causes the different values?
> - Is it just a slight difference, or can I expect significant
> differences in H-F/G-G epsilons and corrected p-Values? With the data
> sets I'm using, the SAS value for H-F epsilon is almost twice the
> value from R, and I'm wondering if there's a mistake on my side or if
> it is just caused by the SAS bug.
> Thanks for any hints...

R has

    HF.eps <- ((n + 1) * pp * GG.eps - 2)/(pp * (n - pp * GG.eps))

where n is the degrees of freedom for the SSD matrix and pp is the
dimension after transformation. As far as I could fathom from the SAS
output, SAS is using

    (N * pp * GG.eps - 2)/(pp * (n - pp * GG.eps))

which coincides with the above when n == N - 1. This suggests that
whoever coded up the SAS version generalised (N - 1) in the
denominator to DF but not the N in the numerator.

Some fairly simple invariance considerations show that the SAS formula
cannot be right - it's a bias correction for GG.eps which is
calculated from the eigenvalues of the SSD, and the distribution of
the SSD depends on degrees of freedom only.

> Bela
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907

More information about the R-help mailing list