Session Ready
Exercise

Comparing proportions

In a previous exercise, we generated a binary response outcome in the Acupuncture dataset to indicate whether the percentage decrease from baseline in headache score at Month 12 is greater than 35%. Here we will test the null hypothesis that the group proportions for that binary outcome are equal to determine if there is a significant treatment effect on this binary endpoint.

We will also re-run the test with the tidy function. This will provide a simpler output. The broom library and Acupuncture dataset have been preloaded for this session.

Instructions
100 XP
  • Use the prop.test() function to compare the treatment.group proportions of resp35.month12.
  • Use the tidy() function (broom package) to store the results.
  • Display the treatment difference, i.e. the difference in proportions.