Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: kruskal-wallis test

From   Kit Baum <>
Subject   st: kruskal-wallis test
Date   Sun, 6 Nov 2005 09:40:15 -0500

Herve S. says

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)

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]

These items will then show up in your return list.

Kit Baum, Boston College Economics

* For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index