Parametric Bootstrap

IMS, Ch. 16.1

Prof Randi Garcia

2026-03-23

Parametric bootstrap

Ebola example

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)
    • sampling distribution centered at \(\widehat{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)
    • sampling distribution centered at \(p_0\)!

Bootstrap confidence interval 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.795    0.844
# just for fun!
ebola_bstrap |>
  get_ci(0.9999)
# A tibble: 1 × 2
  lower_ci upper_ci
     <dbl>    <dbl>
1    0.778    0.857

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

ebola_bstrap |>
  visualize() +
  shade_ci(ci)

Interpretation

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

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.