| MauchlyTest | R Documentation |
Tests for sphericity in repeated measures designs. Uses an interface for
type formula dv ~ within | id, where:
dv: variable numerical response,
within: within-subjects factor (repeated levels),
id: subject/sample identifier.
MauchlyTest(formula, data, alpha = 0.05, digits = 4, do_print = TRUE)
formula |
Formula |
data |
|
alpha |
Significance level (default 0.05). |
digits |
Decimals for printing (default 4). |
do_print |
if |
Calculates Mauchly's statistic W, its approximation W
corrected, the p-value and the correction coefficients for lack of
sphericity (Greenhouse–Geisser y Huynh–Feldt).
Objeto de clase "sphericity" with:
Cadena con el método.
Lista con W y Chi2.
Grados de libertad.
Valor-p.
"Sphericity" o "No sphericity" según alpha.
GG and HF.
List with n (subjects), k (levels), S (covariances), eigen (eigenvalues).
Mauchly, J. W. (1940). Significance test for sphericity of a normal n-variate distribution. The Annals of Mathematical Statistics, 11(2), 204–209. https://doi.org/10.1214/aoms/1177731915
# Ejemplo mínimo (datos ficticios):
set.seed(1)
d <- data.frame(
id = rep(1:10, each = 4),
within = rep(paste0("t", 1:4), times = 10),
y = as.numeric(rep(rnorm(10, 10, 2), each = 4)) +
rep(c(0, .5, 1.2, .8), times = 10) + rnorm(40, 0, 1)
)
res <- MauchlyTest(y ~ within | id, data = d, do_print = TRUE)
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.