Background

This experiment was included in the original research paper by Kruskal and Wallis (Use of Ranks in One-Criterion Variance Analysis, 1952) to demonstrate the Kruskal-Wallis test.

“Snedecor’s data on the birth weight of pigs [Snedecor, George W., Statistical Methods, Ames, Iowa State College Press, 1937 and later, Table 10.12] are shown in” the table below.

Data Table (click to view)

The research question surrounding the data was weather or not the various weights of pigs in the different litters were comparable or not. In other words, does a given mother always give birth to piglets that come from the same weight distribution? Or is there evidence that at least one litter came from a different distribution of weights than the others?

Analysis

Note that the assumptions of an ANOVA test do not appear to be violated for these data. However, in keeping with the presentation of the original authors of the Kruskal-Wallis test, this data will be analyzed with a Kruskal-Wallis Test.

The null hypothesis is that the various litters represent samples of weights from the same population. The alternative hypothesis is that at least one of the samples is from a different population, with similar shape, but shifted either higher or lower than the others.

#Note that this R-Chunk began with: ```{r, comment=NA} 
kruskal.test(Weight ~ Litter, data=pigweights)

    Kruskal-Wallis rank sum test

data:  Weight by Litter
Kruskal-Wallis chi-squared = 18.565, df = 7, p-value = 0.009663

It appears that at least one litter represents a sample of weights that are from a different population than the others \((p=0.009663)\). The following graphic displays the data.

boxplot(Weight ~ Litter, data=pigweights, 
        col="lightgray", xlab="Litter Number", main="Weights of Piglets for 8 Different Litters from One Mother", ylab="Piglet Weight")
stripchart(Weight ~ Litter, data=pigweights, 
           vertical=TRUE, pch=16, add=TRUE, col="skyblue3")

pander(favstats(Weight ~ Litter, data=pigweights)[,-10])
Litter min Q1 median Q3 max mean sd n
1 1.1 2.2 3 3.3 4.4 2.84 0.9536 10
2 1.6 2.225 2.6 3.275 3.5 2.663 0.705 8
3 2.6 3.125 3.2 3.3 3.6 3.18 0.2741 10
4 2.5 2.75 3.05 3.225 3.3 2.975 0.3196 8
5 2 2.025 2.35 2.6 2.9 2.367 0.383 6
6 2.5 2.8 3 3.1 3.1 2.9 0.2828 4
7 1.2 1.45 2.2 2.425 2.6 1.983 0.6274 6
8 1.4 2.15 2.45 2.625 3 2.325 0.6702 4

Interpretation

While the results of the test show that not all litters are coming from the same weight distribution, it is difficult to decipher what is going on. Litter 3 had the heaviest distribution of piglets. Litter 7 had the lowest median weight of piglets even though Litter 1 has the single piglet with the smallest weight (lowest minimum).

However, the Kruskal-Wallis test does not provide information as to why the null hypothesis was rejected, only that at least one of these litters is different from the others. At this point it would be beneficial to understand more about the circumstances surrounding each litter so that the full story can be pieced together. Was the diet of the mother different prior to delivering each litter? Was the sire of the pigs different for each litter? This data actually produces more questions than it answers, but questions lead to future research, so the study was useful in that aspect.