R 統計推論基礎
Jo Hardin
Instructor
# Compare confidence intervals
one_poll_boot %>% summarize(
lower = p_hat - 2 *
sd(prop_yes_boot),
upper = p_hat + 2 *
sd(prop_yes_boot))
# A tibble: 1 × 2
lower upper
<dbl> <dbl>
1 0.536148 0.863852
# Find 2.5% and 97.5% of p-hat vals
one_poll_boot %>% summarize(
q025_prop = quantile(prop_yes_boot,
p = .025),
q975_prop = quantile(prop_yes_boot,
p = .975))
# A tibble: 1 × 2
q025_prop q975_prop
<dbl> <dbl>
1 0.5333333 0.8333333
目標:只知道統計量時,推估母體參數
無法知道你抽到的樣本是否真的包含真實參數
自助法 t 信賴區間: (0.536, 0.864)
百分位數區間: (0.533, 0.833)
我們有 95% 的把握,候選人 X 的支持比例介於 0.536 到 0.864(或 0.533 到 0.833)之間
統計量的抽樣分配大致對稱、鐘形
樣本數夠大
重抽比例的變異性
R 統計推論基礎