Session Ready
Exercise

Randomizing opportunity cost

As in Chapter 2 Exercise 5, you will permute the data to generate a distribution of differences as if the null hypothesis were true.

In the study, the number of individuals in each of the control and treatment groups is fixed. Additionally, when you assume that the null hypothesis is true—that is, the experiment had no effect on the outcome of buying a DVD—it is reasonable to infer that the number of individuals who would buy a DVD is also fixed. That is, 97 people were going to buy a DVD regardless of which treatment group they were in.

Using the new data and the methods from the previous chapter, create a randomization distribution of the difference in proportions calculated on permuted data.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3
  • Using the opportunity dataset, calculate the observed difference in purchase rate.
    • Group by group.
    • Summarize to calculate the proportion deciding to buy a DVD. That is, get the mean() of cases of decision equalling "buyDVD".
    • Summarize again to calculate the diff()erence of prop_buy between groups.