I run the Kruskal - Wallis tests of differences between groups. (In
reality, I use a variation -kwallis2- [donwloadable from ssc] which
provides the rank mean as well as the rank sum (-kwallis- only
provides the ranksum).
kwallis2 index2, by(sodas3cl)
(snip)
This code was written by another Herve, Herve Caci, back in 1999 for
Stata 5.0. Back then there was not the simple means of returning
items in a return list (one could return macros in S_1, S_2, etc. and
it does return a few--presumably not the ones you need).
Make a copy of kwallis2.ado (kwallis3.ado?), change the version
number to something more recent (e.g. version 8.2), change the
program define line to read "program define kwallis3, rclass" and see
if the routine still runs and generates the same results. If so, add
return statements for each item you would like to use after the
routine runs. E.g. `Mean'`[`i'] (which is the i'th observation of a
tempvar named `Mean') is the rank mean for the i-th group. Put it in
a scalar and return it, e.g.
return scalar mean1 = `Mean'[1]
etc.
These items will then show up in your return list.