|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectKruskalWallis
public class KruskalWallis
KruskalWallis - a Java utility to perform a Kruskal-Wallis test on a table of data
The Kruskal-Wallis test is a non-parametric statistical test used to assess the difference between three or more independent samples, which is to say, between three or more conditions assigned between-subjects. The relationship with other non-parametric tests is illustrated below:
The test is also called a one-way analysis of variance by ranks. If the test is used with interval or ratio-scale data, the data are first converted to ranks. Using the Kruskal-Wallis test for interval or ratio data might be preferred over a parametric ANOVA if there is a concern over the underlying assumptions in the distribution of the data. The researcher must bear in mind, however, that the data transformation bears a cost. Information is sacrificed. For example, interval or ratio scores of 10, 49, and 50 are converted to ranks 1, 2, and 3.
The null hypothesis is that the populations from which the samples originate have the same median. A statistically significant outcome means that at least one of the samples (i.e., conditions) is significantly different from at least one other sample. To determine which pairs of samples differ significantly from one another, a post hoc pairwise comparisons test is performed (see below).
Invocation (usage message if invoked without arguments):
Example. Consider an experiment to test whether age will be a factor in the acceptance of
a new GPS system. Eight participants are recruited from each of three age groups (20-29, 30-39,
40-49). The participants are given a demo of a new GPS system, then asked if they liked it enough
to purchase it for personal use. They respond on a 10-point linear scale (1= definitely no, 10 =
definitely yes). The responses are saved in kruskalwallis-ex1.txt as a matrix with 8 rows and 3 columns. The
data are then processed by the KruskalWallis
utility. For example,
The test statistic H follows the chi-square distribution with k - 1 degrees for freedom (k = number of conditions). Since p is below the customary threshold for significance (.05), we reject the null hypothesis. The conclusion is that age is a factor in acceptance of the new design for a GPS system.
The test also provides H' which is corrected for ties. The difference is usually minor.
StatView provides the following output using the data above:
Post hoc comparisons. If the test reveals statistical significance (as above), a post hoc
pairwise comparisons test is needed to determine which pairs of conditions (samples) differ
significantly from one another. This is available using the -ph
option:
The test reveals that only the samples in columns 1 and 3 are significantly different. The verbose output (see below) provides a rough verification of this, since the means for columns 1 and 3 were 18.5 and 7.9, respectively.
The multiple comparisons test uses the procedure given by Siegel and Castellan in "Nonparametric Statistics for the Behavioral Sciences" (McGraw-Hill, 1988, pp. 213-214; described in a posting on www.talkstats.com).
Missing data. An additional feature of the KruskalWallis
utility is
accommodation for missing data. If the sample sizes (number of participants) differ among the
conditions, substitute a period (".") for missing data. An example is found in kruskalwallis-ex2.txt:
The example above contains scores from a study on wine tasting (see http://vassarstats.net/textbook/ch14a.html).
Constructor Summary | |
---|---|
KruskalWallis()
|
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KruskalWallis()
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |