Aan de slagGa gratis aan de slag

CI via approximation

The approximation shortcut offers an alternative method of describing the sampling distribution. In this exercise, you will apply the approximation shortcut to build a confidence interval for the proportion of respondents that live in the pacific region.

When building any confidence interval, note that you use three ingredients: the point estimate (here, p_hat), the SE, and the number of standard errors to add and subtract. For a sampling distribution that is bell-shaped, adding and subtracting two SEs corresponds to a confidence level of 95%. When you use the bootstrap, you can check that the distribution is bell-shaped because you have a have the bootstrap distribution to plot. When you use the approximation, you're flying blind — well, not quite blind, but you are dependent on the "rule of thumb" to ensure that you're working with a bell shape.

Deze oefening maakt deel uit van de cursus

Inference for Categorical Data in R

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Calculate n as the number of rows
n <- nrow(gss2016)

# Calculate p_hat as the proportion in pacific meta region
p_hat <- gss2016 %>%
  ___(prop_pacific = ___(___ == "___")) %>%
  pull()

# See the result
p_hat
Code bewerken en uitvoeren