*! version 1.1.1 11jul2025

Title

pwkwallis -- Kruskal-Wallis equality-of-populations rank test and non-parametric pairwise
comparisons across the levels of factor variables

Syntax

pwkwallis varname [if] [in], "by(varlist:groupvar)" [bonferroni]

Description

This command performs Kruskal-Wallis equality-of-populations rank test and non-parametric pairwise
comparisons across the levels of factor variables. The tests can be adjusted for multiple comparisons
by Bonferroni's methods using the bonferroni option.

In the syntax diagram above, varname refers to the variable recording the outcome,
and groupvar refers to the variable denoting the population.
by() is required.

You can click here to pop up a dialog or type db pwkwallis.

Execute net from http://metodo.uab.cat/stata for install.

It is important to keep the commands updated. Execute adoupdate pwkwallis, update to update the pwkwallis command.

Execute adoupdate, update to update all the user-written commands.

This command uses the kwallis and _mtest Stata commands.

If you find any bugs or want to suggest any improvements, please send an e-mail to: leam@uab.cat.

Examples

. use http://metodo.uab.cat/stata/AlcoholTR.dta

. pwkwallis TR, by(Alcohol)

. pwkwallis TR, by(Alcohol) bonferroni

Stored results

pwkwallis stores in r(results) a matrix with the contrast, standard error, t and p values (adjusted if bonferroni option
is present) for each pairwise comparison.

Version

Version 1.1.1 -- 11 July 2025

Authors

JM.Doménech

Programmer: R.Sesma

Laboratori d'Estadística Aplicada

Universitat Autònoma de Barcelona

leam@uab.cat

Vancouver reference

Doménech JM. Kruskal-Wallis equality-of-populations rank test and non-parametric pairwise comparisons across

the levels of factor variables: User-written command pwkwallis for Stata [computer program].

V1.1.1. Bellaterra: Universitat Autònoma de Barcelona; 2025.

Available executing from Stata: net from http://metodo.uab.cat/stata

References

Conover WJ. Practical Nonparametric Statistics. 3th ed. New York: John Wiley and Sons; 1999.

Doménech JM. Fundamentos de Diseño y Estadística. UD 12. Comparación de varias medias:
Análisis de la variancia. 15ª ed. Barcelona: Signo; 2014.