1. Learn
  2. /
  3. Courses
  4. /
  5. Hypothesis Testing in R

Connected

Exercise

Test for single proportions

In Chapter 1, you calculated a p-value for a test hypothesizing that the proportion of late shipments was greater than 6%. In that chapter, you used a bootstrap distribution to estimate the standard error of the statistic. A simpler alternative is to use an equation for the standard error based on the sample proportion, hypothesized proportion, and sample size.

\(z = \dfrac{\hat{p} - p_{0}}{\sqrt{\dfrac{p_{0}*(1-p_{0})}{n}}}\)

Let's revisit the p-value using this simpler calculation.

late_shipments is available; dplyr is loaded.

Instructions 1/3

undefined XP
    1
    2
    3
  • Hypothesize that the proportion of late shipments is 6%.
  • Calculate the sample proportion of shipments where late equals "Yes" as prop_late, and pull out the value to get a numeric value.
  • Calculate the number of observations in the sample.