Exercise

Hypothesis test on the difference in proportions

In the last exercise you learned that about 52% of women favor the death penalty while about 63% of men do, a difference of about 11 percentage points. That seems like a large difference, but what if it's just due to chance and in fact there is no relationship between sex and support for the death penalty? Find out by testing the null hypothesis that sex and support for the death penalty are independent of one another.

The statistic that you'll be using in this exercise is a "diff in props", which requires that you specify the order of the difference by adding an argument, order = c("FIRST", "SECOND"), where first and second refer to the group names. This results in the calculation: FIRST - SECOND.

Instructions 1/3

undefined XP
    1
    2
    3

Set up an infer chain which ends with the calculation of many differences in proportions, calculated as the proportion of "FEMALE" that "FAVOR" minus the proportion of "MALE" that do. Save the result to null.