A SAS(®) macro implementation of a multiple comparison post hoc test for a Kruskal-Wallis analysis
Related Experiment Video
Updated: Apr 23, 2026

Flypub To Study Ethanol Induced Behavioral Disinhibition and Sensitization
Published on: May 18, 2020
Alan C Elliott1, Linda S Hynan
1Department of Clinical Sciences, Division of Biostatistics, UT Southwestern Medical Center, Dallas, TX 75390-8822, United States. alan.elliott@utsouthwestern.edu
Abstract:
The Kruskal-Wallis (KW) nonparametric analysis of variance is often used instead of a standard one-way ANOVA when data are from a suspected non-normal population. The KW omnibus procedure tests for some differences between groups, but provides no specific post hoc pair wise comparisons. This paper provides a SAS(®) macro implementation of a multiple comparison test based on significant Kruskal-Wallis results from the SAS NPAR1WAY procedure. The implementation is designed for up to 20 groups at a user-specified alpha significance level. A Monte-Carlo simulation compared this nonparametric procedure to commonly used parametric multiple comparison tests.
Related Concept Videos
One-Way ANOVA: Unequal Sample Sizes
Multiple Comparison Tests
It would be easy to compare two samples using a significance alpha level of 0.05. In other words, there is only one sample pair to be compared. However, it would be difficult to identify a significantly different sample if the number...
Kruskal-Wallis Test
Bonferroni Test
The means of different samples are first paired in all possible combinations.
The null hypothesis of the...
Friedman Two-way Analysis of Variance by Ranks
Comparing the Survival Analysis of Two or More Groups

