Session Ready
Exercise

Subgroups

Suppose that in the Acupuncture study, we are interested in seeing if there is a treatment effect in any of the age subgroups of patients for the total number of days off sick. Due to the multiple testing, we will use the Bonferroni correction to adjust the significance level.

The variable total.days.sick is not normally distributed so we will use the non-parametric Wilcoxon Rank Sum test to compare the distributions between the treatment groups.

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

Instructions
100 XP
  • Tabulate age.group to view the age categories.
  • Based on the number of age groups, display the Bonferroni significance level.
  • Create a list of age ranges (18-34, 35-44, 45-54, 55-65) defined as age.
  • Use the wilcox.test() to compare the distributions total.days.sick by treatment.group in each of the age subgroups.