Parametric Bootstrap

IMS, Ch. 16.1

Smith College

Mar 22, 2026

Review: bootstrap CI

Recall the Ebola survey

library(tidyverse)
library(openintro)
ebola_survey |>
  group_by(quarantine) |>
  summarize(num_responses = n()) |>
  mutate(pct = num_responses / sum(num_responses))
# A tibble: 2 × 3
  quarantine num_responses   pct
  <fct>              <int> <dbl>
1 against              188 0.180
2 favor                854 0.820
library(infer)
p_hat <- ebola_survey |>
  observe(response = quarantine, success = "favor", stat = "prop")
p_hat
Response: quarantine (factor)
# A tibble: 1 × 1
   stat
  <dbl>
1 0.820

Inferential procedures

  • To find a confidence interval for a proportion:
    • We used the bootstrap (Ch. 12)
    • Later, we’ll learn a different method (normal approximation, Ch. 16.2)
    • Note: sampling distribution centered at \(\hat{p}\)
  • To conduct a hypothesis test for a proportion:
    • We use the parametric bootstrap (Ch. 16.1)
    • Later, we’ll learn a different method (normal approximation, also Ch. 16.2)
    • Note: sampling distribution centered at \(p_0\)!

Bootstrap CI for a proportion

ebola_bstrap <- ebola_survey |>
  specify(response = quarantine, success = "favor") |>
  generate(1000, type = "bootstrap") |>
  calculate(stat = "prop")
ci <- ebola_bstrap |>
  get_ci()
ci
# A tibble: 1 × 2
  lower_ci upper_ci
     <dbl>    <dbl>
1    0.797    0.843

The sampling distribution of \(\hat{p}\)

ebola_bstrap |>
  visualize() +
  shade_ci(ci) +
  geom_vline(data = p_hat, aes(xintercept = stat), size = 3, color = "red")

Interpretation

Interpretation

We are 95% confident that the true proportion of New Yorkers in 2014 who favored mandatory quarantine is between 0.797 and 0.843.

Parametric bootstrap

Let’s test a hypothesis:

  • \(H_0\): \(p = 0.75\)
  • \(H_A\): \(p \neq 0.75\)
  • Set \(\alpha = 0.05\)
  • We call the hypothesized proportion \(p_0 = 0.75\)

The sampling distribution of \(p_0\)

ebola_pbstrap <- ebola_survey |>
  specify(response = quarantine, success = "favor") |>
  hypothesize(null = "point", p = 0.75) |>
  generate(1000, type = "draw") |>
  calculate(stat = "prop")
ebola_pbstrap |>
  visualize() +
  shade_p_value(obs_stat = p_hat, direction = "two-sided")

Interpretation

  • We reject the null hypothesis that the true proportion of New Yorkers in 2014 who favored mandatory quarantine was 0.75 at the 5% level.

  • We conclude that more than 75% of New Yorkers favored mandatory quarantine.