SNKTest: Student-Newman-Keuls (SNK) Test for Multiple Comparisons

View source: R/SNKTest.R

SNKTestR Documentation

Student-Newman-Keuls (SNK) Test for Multiple Comparisons

Description

Performs the Student-Newman-Keuls (SNK) post hoc test for pairwise comparisons after fitting an ANOVA model. The test uses a stepwise approach where the critical value depends on the number of means spanned between groups (range r).

Usage

SNKTest(modelo, alpha = 0.05)

Arguments

modelo

An object of class aov or lm representing an ANOVA model.

alpha

Significance level (default is 0.05).

Details

SNK is more powerful but less conservative than Tukey’s HSD, increasing the chance of detecting real differences while slightly raising the Type I error rate.

Assumptions: normality, homogeneity of variances, and independence of observations.

Advantages: - More powerful than Tukey when differences are large. - Intermediate control of Type I error.

Disadvantages: - Error control is not family-wise. - Type I error increases with more comparisons.

Value

An object of class "snk" and "comparaciones", containing:

  • Resultados: A data frame with pairwise comparisons, including mean differences, critical values, p-values, and significance codes.

  • Promedios: A named numeric vector of group means.

  • Orden_Medias: A character vector with group names ordered from highest to lowest mean.

  • Metodo: A character string indicating the test used ("SNK").

References

Student, Newman, and Keuls (1952). "Student-Newman-Keuls Procedure". See also: <https://doi.org/10.1002/bimj.200310019>

Examples

data(d_e, package = "Analitica")
mod <- aov(Sueldo_actual ~ as.factor(labor), data = d_e)
resultado <- SNKTest(mod)
summary(resultado)
plot(resultado)


Analitica documentation built on June 14, 2025, 9:07 a.m.