Learning Outcomes
By the end of this section, students will be able to:
- Explain the importance of the parametric assumptions and determine if they have been met
- Explain the basic principles of rank based non-parametric statistical tests
- Describe the use of a range of common non-parametric tests
- Conduct and interpret common non-parametric tests
You can download a copy of the slides here: B3.4 Wilcoxon Signed Rank Test
B3.4 PRACTICAL: R
We wish to use the Wilcoxon Signed Rank Test to determine if there is a significant difference in body condition score across all mice in the study between the start (BCS_baseline) and end (BCS_end) of the trial.
We use the wilcox.test command to perform this test in R. We specify the two variables, and must use paired=TRUE since the measurements are coming from the same subject:
> wilcox.test(data$BCS_baseline, data$BCS_end, paired = TRUE, exact = FALSE)
The RStudio output looks like this:

There is no significant difference (p>0.05) in body condition score of the mice between the start and the end of the study.
Question B3.4: Is there a significant difference between weight at the beginning and weight at the end?
Answer
We use the following R code:
> wilcox.test(data$Weight_end, data$Weight_baseline, paired = TRUE, exact = FALSE)
The RStudio output looks like this:

From this, we can conclude that there is no significant difference (p>0.05) in the weight of the mice between the start and the end of the study.
B3.4 PRACTICAL: Stata
Use the Wilcoxon Signed Rank Test to determine if there is a significant difference in body condition score across all mice in the study between the start (BCS_baseline) and end (BCS_end) of the trial.
We use the ‘signrank’ command to perform this test in Stata:

Here we can conclude that there is no significant difference in body condition score of the mice between baseline and end of the trial (p=1.00).
Question B3.4: Is there a significant difference between weight at the beginning and weight at the end?
Answer

And based on this we can also say that there is no significant difference in weight of the mice between baseline and end of the trial (p=0.93).
B3.4 PRACTICAL: SPSS
Use the Wilcoxon Signed Rank Test to determine if there is a significant difference in body condition score across all mice in the study between the start (BCS_baseline) and end (BCS_end) of the trial.
Select
Analyze >> Nonparametric Tests >> Legacy Dialogs >> 2 Related Samples
SPSS assumes that each row is a separate participant or case, so for all repeated measures tests it requires each measure to be a separate variable.
Move the two variables you are interested in into the spaces for Variable 1 and Variable 2 in Pair 1.
Make sure Wilcoxon is selected at the bottom of the box before you press ‘OK’ to run the test.

You will notice that a second blank ‘pair’ is automatically created when you have completed the first pair. Also, your variables do not disappear from the box on the left hand side as they do in the majority of tests. This is because you can create multiple pairs to test in one go, and you can compare one variable to any number of variables.
Run the analysis again, but add in a comparison of weight at the beginning and weight at the end as well.Â
Answer


Here we can conclude that there is no significant difference in body condition score of the mice between baseline and end of the trial.


And based on this we can also say that there is no significant difference in weight of the mice between baseline and end of the trial.
Great