dunntest.  Dunn's test of multiple comparisons using rank sums
Program by Alexis Dinno.
Support: alexis.dinno@pdx.edu
Version: 1.3.9 (updated February 18, 2026)
Distribution-Date: 18feb2026

This package includes dunntest and the data set homecare which is 
reproduced from Dunn's original 1964 paper. dunntest performs 
approximate z tests of nonparametric null hypothesis of stochastic 
equality, and under certain assumptions tests nonparametric null hypotheses
of median equality. Dunn's test is the appropriate multiple pairwise 
comparison procedure following the rejection of the null hypothesis in a
Kruskal-Wallis test. The data used in Dunn's paper are presented here in
the homecare.dta file. 

This package is written for STATA versions 8+, however, requests for a 
version compatible with versions of STATA earlier than v8 are untenable since 
I do not have access to the software.

All feature and bug requests are welcome and will be considered.

HISTORY

18feb2026 (1.3.9)  minor improvements to documentation. refactored to protect  
                   namespace conflicts.  

12feb2026 (1.3.8)  minor improvements to output

10feb2026 (1.3.7)  corrected p value notation in output, and made output more
                   informative. incorporated unicode into output for versions
                   of stata 14+. refactored dunntest. added a second example in
                   the documentation.

26jun2019 (1.3.6)  unreleased

03may2018 (1.3.5)  corrected an obscure bug where variable names beginning
                   with "P" would break dunntest.

28feb2018 (1.3.4)  corrected a bug where significant rejections were not
                   underlined or starred in the output when using FDR
                   options for ma().

26oct2017 (1.3.3)  added the altp option to express p-values asp = P(|Z| >= |z|)
                   in output, and include the rejection rule for Ho explicit in
                   the output. documentation changes.

27apr2017 (1.3.2)  made dunntest play nice with Stata versions 8 through 13

08apr2017 (1.3.1)  corrected a bug where significant rejection was indicated
                   incorrectly for bonferroni and sidak multiple comparisons
                   adjustments, that was created in the previous update.

05apr2017 (1.3.0)  added a new list option, to include all pairwise
                   tests as a list. various minor improvements to output
                   made in general, including specific reporting of level
                   of sigificance, and indicating which tests are rejected
                   for no multiple comparisons adjustments, the Bonferroni
                   adjustment, and the Sidák adjustment.

08feb2017 (1.2.17) fixed a formatting bug that mangled the table at the end
                   of non-wrapping output with many comparisons.

06sep2016 (1.2.16) the previous bug fix could permanently encode the 
                   groupvar if it had been coded as a string. this 
                   behavior has been fixed.

04sep2016 (1.2.15) made dunntest play nicely when groupvar is
                   specified as a string variable rather than a numeric 
                   variable with value labels.

07jan2016 (1.2.14) fixed a fatal yet ridiculous bug in yesterday's update.

06jan2016 (1.2.13) fixed a bug that could sometimes hide some of the output
                   of non-wrapping results when the number of groups was 
                   greater than 7.

15dec2015 (1.2.12) updated to reflect new web domain.

27apr2015 (1.2.11) fixed a bug where output was broken when the number of 
                   groups was greater than 7 and the wrap option was not
                   used.

17apr2015 (1.2.10) even better handling of labels, now featuring explicit
                   warnings and separate handling of incomplete labeling
                   of groupvar.

03mar2015 (1.2.9)  fixed yet another variation on the value label bug, where 
                   values of the group variable not conforming to 1 – k
                   got munged. seemingly fixed now. until the next variation.
                   minor update to the help file.

08feb2015 (1.2.8)  fixed two bugs: (1) the pairwise tests table was labeled
                   Row Mean-Col Mean, but actually reported Col Mean-Row Mean.
                   the signs of the test statistics were thus reversed. The 
                   table is now labeled Col Mean-Row Mean, but there is a new
                   rmc option to report the opposite. (2) when using value
                   labels in conjunction with either if or by conditionals
                   the correct tests were reported, but with the wrong labels
                   attached. this bug did not affect results presented using
                   the nolabel option.

08jan2015 (1.2.7)  correcting the silly bug introduced in 1.2.6

08jan2015 (1.2.6)  corrected a serious bug where dunntest handled an if or 
                   in statement for the kruskal-wallis test, but not for 
                   dunn's actual test

10dec2014 (1.2.5)  minor documentation update to clarify the quantities in 
                   dunntest's output.

08oct2014 (1.2.4)  bug fix: if dunntest was called without the nolabel
                   option when the values of the group variable did not 
                   have value labels, thr proghram would exit gracelessly, 
                   rather than simply using the values of the group 
                   variable themselves as labels. this has been fixed,
                   although dunntest will still choke if you supply a  
                   group variable with only some, not all, values labeled.

07oct2014 (1.2.3)  bug fixes: (1) dunntest would exit if a variable named
                   "order" was in memory, and (2) dunntest would goof
                   multiple comparisons output if value labels for a 
                   groupvar had values other than natural numbers (i.e. 
                   values in 1, 2, ..., k).

08sep2014 (1.2.2)  now properly ignores missing observations in scores or
                   in groups.

05sep2014 (1.2.1)  a seemingly subtle bug in stata prompted the need of a
                   bug fix (dunntest would err if variables beginning with 
                   capital 'P' or 'Z' were in memory).

25aug2014 (1.2.0)  added options for hochberg's control of the family-wise
                   error rate, and for benjamini-yekutieli's control of the
                   false discovery rate under dependency. made minor 
                   correction of documentation.

29jun2014 (1.0.1)  a small correction to the kwallis example in the 
                   documentation, which mistakenly included the option
                   "ma(none)" in the kwallis command.

06mar2014 (1.0.0)  dunntest is first released with decent presentation
                   options, and documentation. the program permits 
                   adjustments for multiple comparisons using the 
                   bonferroni adjustment, sidak adjustment, holm stepwise
                   adjustment, holm-sidak stepwise adjustment, or the
                   benjamini-hochberg adjustment.
