1. Learn
  2. /
  3. Courses
  4. /
  5. Inferential Statistics

Exercise

Comparing two proportions (3)

So now we know both the difference in proportions and we know our standard error. We now have enough information to calculate the z value. The formula for the z value of differences between two proportions in slightly different from the regular formula but it will generally feel very familiar. The formula is displayed below:

$$Z = \frac{(\hat{p_1} - \hat{p_2} - null hypothesis value)}{se_0}$$

Instructions

100 XP
  • Using the data and code in our sample code, calculate the Z value and store it in a variable z_value.
  • Print the variable z_value to the console