| ScheffeTest | R Documentation |
Performs Scheffe's post hoc test after fitting an ANOVA model. This test compares all possible pairs of group means, using a critical value based on the F-distribution.
ScheffeTest(modelo, comparar = NULL, alpha = 0.05)
modelo |
An |
comparar |
Character vector with the name(s) of the factor(s) to compare:
- One name: main effect (e.g., "treatment" or "A")
- Several names: interaction (e.g., |
alpha |
Significance level (default 0.05). |
The Scheffe test is a conservative method, making it harder to detect significant differences, but reducing the likelihood of Type I errors (false positives). It is especially appropriate when the comparisons were not pre-planned and the number of contrasts is large.
Assumptions: normally distributed residuals and homogeneity of variances.
Advantages: - Very robust to violations of assumptions. - Suitable for complex comparisons, not just pairwise.
Disadvantages: - Very conservative; reduced power. - Not ideal for detecting small differences.
Objeto de clase "scheffe" and "comparaciones" with:
Resultados: data.frame with Comparacion, Diferencia,
SE2 (= MSerror*(1/n_i+1/n_j)), F_obs, Valor_Critico, p_value, Significancia.
Promedios, Orden_Medias, Metodo="Scheffe", Termino.
MSerror, df_error, N (utiles para plot.comparaciones()).
Scheffe, H. (1953). "A method for judging all contrasts in the analysis of variance." Biometrika, 40(1/2), 87–104. <https://doi.org/10.1093/biomet/40.1-2.87>
data(d_e, package = "Analitica")
mod <- aov(Sueldo_actual ~ as.factor(labor), data = d_e)
resultado <- ScheffeTest(mod)
summary(resultado)
plot(resultado)
# RCBD
mod <- aov(Sueldo_actual ~ as.factor(labor) + Sexo, data = d_e)
res <- ScheffeTest(mod, comparar = "as.factor(labor)")
summary(res); plot(res) # plot usara p_value
# Factorial
mod2 <- aov(Sueldo_actual ~ as.factor(labor) * Sexo, data = d_e)
resAB <- ScheffeTest(mod2, comparar = c("as.factor(labor)","Sexo"))
summary(resAB, n = Inf); plot(resAB, horizontal = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.