# Example of Kruskal-Wallis Test

A health administrator wants to compare the number of unoccupied beds for three hospitals. The administrator randomly selects 11 days from the records of each hospital and enters the number of unoccupied beds for each day. To determine whether the median number of unoccupied beds differs, the administrator uses the Kruskal-Wallis test.

1. Open the sample data, HospitalBeds.MTW.
2. Open the Kruskal-Wallis Test dialog box.
• Mac: Statistics > ANOVA > Kruskal-Wallis
• PC: STATISTICS > ANOVA > Kruskal-Wallis
3. Select Responses are in one column for all factor levels.
4. In Response, enter Beds.
5. In Factor, enter Hospital.
6. Click OK.

## Interpret the results

The sample medians for the three hospitals are 16, 31, and 17. The average ranks show that hospital 2 differs the most from the average rank for all observations and that this hospital is higher than the overall median.

Both p-values are less than the significance level of 0.05. The p-values indicate that the median number of unoccupied beds differs for at least one hospital.

 Descriptive Statistics
 Hospital N Median Mean Rank Z-Value 1 11 16 14.0 -1.28 2 11 31 23.3 2.65 3 11 17 13.7 -1.37 Overall 33 17.0
 Test
 Null hypothesis H₀: All medians are equal Alternative hypothesis H₁: At least one median is different
 Method DF H-Value P-Value Not adjusted for ties 2 7.05 0.0295 Adjusted for ties 2 7.05 0.0294
By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy