# Kruskal-Wallis test

This procedure is available in both the Analyse-it Standard and the Analyse-it Method Evaluation edition

Kruskal-Wallis test is a non-parametric test for a difference in central location (median) between two or more independent samples.

The requirements of the test are:

- Two or more independent samples measured on an ordinal or continuous scale.
- Samples have similar shape distributions, although the distributions need not be normal.

- Arranging the dataset
- Using the test
- Comparing groups with multiple comparisons
- References to further reading

## Arranging the dataset

Data in existing Excel worksheets can be used and should be arranged in a List dataset layout or Table dataset layout. The dataset must contain a continuous scale variable and a nominal/ordinal scale variable containing two or more independent groups.

When entering new data we recommend using New Dataset to create a new **2 variables (1 categorical)** dataset ready for data entry.

**Using the test**

To start the test:

- Excel 2007:

Select any cell in the range containing the dataset to analyse, then click**Compare Groups**on the**Analyse-it**tab, then click**Kruskal Wallis**. - If the dataset is arranged using the table layout:

The**Variable - Groups**list shows the observed variable split by the groups. Tick the samples to compare.If the dataset is arranged using the list layout:

Click**Variable**and select the dependent variable and click**Factor**and select the independent variable containing the groups to compare. - Click
**OK**to run the test.

Excel 97, 2000, 2002 & 2003:

Select any cell in the range containing the dataset to analyse, then click **Analyse **on the **Analyse-it **toolbar, click **Compare Groups** then click **Kruskal Wallis**.

The report shows the number of observations analysed, and, if applicable, how many missing values were excluded. Summary statistics for the ranks of each sample are also shown.

The Kruskal-Wallis statistic and hypothesis test are shown. The *p*-value is the probability of rejecting the null hypothesis, that the samples have the same median, when it is in fact true. A significant p-value implies that at least two samples have different medians. To determine which samples differ perform multiple comparisons.

** METHOD ** The *p*-value is calculated using the chi-square approximation with correction for ties (see [2]). When the number of observations are ≤ 25 it is recommended to lookup an exact p-value (see [2]).

## Comparing groups with multiple comparisons

**Multiple comparisons** allow pairs of groups to be compared to determine which are different. When comparing many groups the chance of committing a type I error increases. To reduce the risk multiple comparisons should only be made when the Kruskal-Wallis test is significant. The risk is further reduced with error protection methods:

*Bonferroni***METHOD**See [1] and [2] for more information on how the multiple comparisons are calculated.*LSD*

To calculate multiple comparisons:

- If the Kruskal-Wallis dialog box is not visible click
**Edit**on the**Analyse-it**tab/toolbar. - Click
**Contrasts**then select**All pairwise**to compare each group against each other, or select**Many against control**to compare each group against a control. - Click
**Error protection**then select**Bonferroni**or**LSD**. - If contrasting
**Many against a control**click**Control group**then select the group to use as the control against which all other groups will be contrasted. - Click
**OK**.

The groups compared, the difference between mean ranks, and hypothesis test are shown. If the p-value is significant the group medians are different.

To disable multiple comparisons:

- If the Kruskal-Wallis dialog box is not visible click
**Edit**on the**Analyse-it**tab/toolbar. - Click
**Contrasts**then select**None**. - Click
**OK**.

## Further reading & references

- Handbook of Parametric and Nonparametric Statistical Procedures (3rd edition)

David J. Sheskin, ISBN 1-58488-440-1 2003; 757. - Practical Non-parametric Statistics (3rd edition)

Conover W.J. ISBN 0-471-16068-7 1999; 288-297.

- Welcome
- Getting started
- What's new in this version
- Installing Analyse-it
- Starting Analyse-it
- Defining Datasets
- Setting Variable properties
- Running a statistical test
- Working with analysis reports
- Analyse-it Standard edition
- Describe
- Compare groups
- Summary statistics, Box/Dot/Mean plots
- Test Difference in Location
- Independent t-test
- Mann-Whitney test
- 1-way ANOVA
- 2-way ANOVA
- Kruskal-Wallis test
- Median test
- Test Difference in Dispersion
- Test Difference in Proportion
- Compare pairs
- Correlation
- Agreement
- Regression
- Analyse-it Method Evaluation edition
- Citing Analyse-it
- Contact us
- About us