Computes the Greenhouse-Geisser and Huynh-Feldt epsilon correction factors for assessing and correcting for violations of the sphericity assumption in repeated measures ANOVA.
Usage
sphericityEps(S, p, nGroups, n, method = c("both", "gg", "hf"))References
Vonesh, E.F., Chinchilli, V.M. (1997) Linear and Nonlinear Models for the Analysis of Repeated Measurements Marcel Dekker, New York, p.84-86
Crowder, M.J., Hand, D.J. (1990) Analysis of Repeated Measures. Chapman & Hall, London, p.54-55
Examples
# a 4x4 covariance matrix among 4 repeated measurements, 20 subjects,
# one between-subject group
set.seed(1)
A <- matrix(rnorm(16), 4, 4)
S <- A %*% t(A) + diag(4)
sphericityEps(S, p = 4, nGroups = 1, n = 20)
#> gg hf
#> 0.6922218 0.7786745
sphericityEps(S, p = 4, nGroups = 1, n = 20, method = "gg")
#> gg
#> 0.6922218
