Session Ready
Exercise

Comparing distributions

We analyzed pct.month12 using a two-sample t-test as it is normally distributed. However, if the assumption of normality is violated, or the sample size is low (less than around 30), then a non-parametric method, such as the Wilcoxon Rank Sum test, can be used.

The total days off sick endpoint is not normally distributed, therefore we will use the Wilcoxon Rank Sum test to compare the distributions in the two treatment groups.

The ggplot2 library and Acupuncture dataset have been preloaded for this session.

Instructions
100 XP
  • Use the ggplot function to produce boxplots of the total days off sick variable, total.days.sick by treatment group treatment.group in the Acupuncture dataset.

  • Use the wilcox.test to test the null hypothesis that the treatment group distributions are the same.