Chapter 8 Nonparametric Approaches
Non-parametric methods are often employed when variables are not measured with interval-level measurement or when the normality assumptions cannot be satisfied. They typically transform the data to ranks prior to analysis. A good source to review these methods is the Hollander, et al, textbook (Hollander, Wolfe, & Chicken, 2013).
There is one easily implemented non-parametric test for the 1-factor repeated measures omnibus test. It is the Friedman’s Rank Sum test and is implemented in the base R installation with the friedman.test
function.
The function requires the data in wide format but also in matrix form, where the only variables are the repeated measure factor levels. The matrix is arranged so that the levels are columns. We already used this wide format matrix for multivariate linear modeling in chapter 2, so that matrix is still available.
kable(rpt1w.mat)
clean | homecage | iguana | whiptail | krat |
---|---|---|---|---|
24 | 15 | 41 | 30 | 50 |
6 | 6 | 0 | 6 | 13 |
4 | 0 | 5 | 4 | 9 |
11 | 9 | 10 | 14 | 18 |
0 | 0 | 0 | 0 | 0 |
8 | 15 | 10 | 15 | 38 |
8 | 5 | 2 | 6 | 15 |
0 | 0 | 0 | 11 | 54 |
0 | 3 | 1 | 1 | 11 |
7 | 7 | 4 | 7 | 23 |
Execution of the function is accomplished by passing only one argument, the name of the data matrix. The test statistic is a chi-squared variable and it is significant for this data set. Degrees of freed are found as the number of levels of the repeated factor minus one.
friedman.test(rpt1w.mat)
##
## Friedman rank sum test
##
## data: rpt1w.mat
## Friedman chi-squared = 22.061, df = 4, p-value = 0.0001949