Block 2: One-sample tests

Week 12 · Uncertainty II · Imai §7.2.2–7.2.3 · about 4 min

NoteHow this works

Run each cell with Run Code, look at the output, then answer the question at the end of the block. Every cell is editable; Start Over resets it. Errors are information: read them.

A poll of n = 1,018: 550 support the candidate. \(H_0\): \(p = 0.5\).

1. z-statistic and p-values

2. Confidence intervals

3. The same with a built-in function

Conclusion: Do we reject H0 at the 5% level? At the 1% level (two-sided)? How do the CIs agree?
z = 2.57; the two-sided p-value is 0.0102: reject at 5% but not (quite) at 1%. The one-sided p-value is half: 0.0051. We reject H0 at level alpha exactly when the (1 - alpha) CI excludes the null value: 95% CI [0.510, 0.571], 99% CI [0.500, 0.581].