PS 812 - Introduction to Statistical Methods in Political Science
October 27, 2026
\[ \newcommand{\Var}{\text{Var}} \newcommand{\Cov}{\text{Cov}} \newcommand{\Corr}{\text{Corr}} \newcommand{\indep}{\mathrel{\perp\mkern-10mu\perp}} \]
Adapted from Blackwell (2025), Ch. 2
\[\sqrt{n}\left(\hat{\mu} - \mu\right) \xrightarrow{d} \mathcal{N}\left(0, \sigma^2\right)\]
# A tibble: 1 × 3
mean_ft_dem mean_ft_rep mean_ft_diff
<dbl> <dbl> <dbl>
1 45.7 43.4 2.28
We can calculate an estimate of the standard error of the mean using our formula from before
\[\widehat{SE}(\bar{Y}) = \frac{\hat{\sigma}}{\sqrt{n}} = \frac{\sqrt{\frac{1}{n-1}\sum_{i=1}^n \left(Y_i - \bar{Y}\right)^2}}{\sqrt{n}} \]
# A tibble: 1 × 4
mean_ft_diff n sd_ft_diff se_ft_diff
<dbl> <int> <dbl> <dbl>
1 2.28 5477 59.7 0.807
A confidence interval is an estimator that consists of an upper and a lower bound.
A \(100(1-\alpha)\%\) confidence interval for population parameter \(\theta\) is an interval \([l, u]\) where \(l = l(Y_1, Y_2, \dotsc, Y_n)\) and \(u = u(Y_1, Y_2, \dotsc, Y_n)\) are functions of the data such that
\[P(l \le \theta \le u) = 1 - \alpha\]
The bounds are random variables
How can we derive a confidence interval for the population mean \(\mu\)
We’ll focus on an interval that is symmetric and centered on the sample mean
\[P(\underbrace{\bar{Y} - c}_{\text{lower}} \le \mu \le \underbrace{\bar{Y} + c}_{\text{upper}}) = 1 - \alpha\]
Rearrange the probability so that the estimator is in the middle \[\begin{aligned} P(\bar{Y} - c \le \mu \le \bar{Y} + c) &= P(-c \le \mu - \bar{Y} \le c) && \small\color{#777777}{\text{subtract } \bar{Y} \text{ throughout}} \\ &= P(-c \le \bar{Y} - \mu \le c) && \small\color{#777777}{\text{multiply by } -1} \\ &= P\left(-\frac{c}{SE(\bar{Y})} \le \frac{\bar{Y} - \mu}{SE(\bar{Y})} \le \frac{c}{SE(\bar{Y})}\right) && \small\color{#777777}{\text{divide by } SE(\bar{Y}) = \sigma/\sqrt{n} > 0} \end{aligned}\]
The term in the middle is the standardized sample mean \[\frac{\bar{Y} - \mu}{SE(\bar{Y})} = \frac{\bar{Y} - \mu}{\sigma/\sqrt{n}} = \frac{\sqrt{n}(\bar{Y} - \mu)}{\sigma}\]
If we knew its distribution, we could choose \(c\) to make the probability exactly \(1 - \alpha\)
Last week we used the central limit theorem to show that
\[ \sqrt{n}(\bar{Y} - \mu) \xrightarrow{d} \mathcal{N}(0, \sigma^2) \]
And, by extension (continuous mapping theorem), the standardized mean is asymptotically standard normal
\[ \frac{\sqrt{n}(\bar{Y} - \mu)}{\sigma} \xrightarrow{d} \mathcal{N}(0, 1) \]
We now have a pivotal quantity - a function of the data and parameter whose (limiting) distribution does not depend on any unknowns.
Now we just need to find the value of \(c\) that satisfies
\[ P\left(-\frac{c}{SE(\bar{Y})} \le \frac{\bar{Y} - \mu}{SE(\bar{Y})} \le \frac{c}{SE(\bar{Y})}\right) = 1 - \alpha\]
The probability of landing in an interval is just difference of two CDFs. Let \(\Phi()\) be the standard normal CDF
\[\begin{aligned} &= P\left(\frac{\bar{Y} - \mu}{SE(\bar{Y})} \le \frac{c}{SE(\bar{Y})}\right) - P\left(\frac{\bar{Y} - \mu}{SE(\bar{Y})} < -\frac{c}{SE(\bar{Y})}\right) && \small\color{#777777}{\text{upper minus lower}} \\ &\approx \Phi\left(\frac{c}{SE(\bar{Y})}\right) - \Phi\left(-\frac{c}{SE(\bar{Y})}\right) && \small\color{#777777}{\text{asymptotic normality}} \\ &= \Phi\left(\frac{c}{SE(\bar{Y})}\right) - \left[1 - \Phi\left(\frac{c}{SE(\bar{Y})}\right)\right] && \small\color{#777777}{\text{symmetry: } \Phi(-x) = 1 - \Phi(x)} \\ &= 2\Phi\left(\frac{c}{SE(\bar{Y})}\right) - 1 \end{aligned}\]
\[P\left(-\frac{c}{SE(\bar{Y})} \le \frac{\bar{Y} - \mu}{SE(\bar{Y})} \le \frac{c}{SE(\bar{Y})}\right)\]
Set the probability equal to \(1 - \alpha\) and solve for \(c\) using the inverse CDF \(\Phi^{-1}()\)
\[\begin{aligned} 2\Phi\left(\frac{c}{SE(\bar{Y})}\right) - 1 &= 1 - \alpha \\ \Phi\left(\frac{c}{SE(\bar{Y})}\right) &= 1 - \frac{\alpha}{2} && \small\color{#777777}{\text{add 1, divide by 2}} \\ \frac{c}{SE(\bar{Y})} &= \Phi^{-1}\left(1 - \frac{\alpha}{2}\right) && \small\color{#777777}{\text{apply the inverse CDF}} \\ c &= \Phi^{-1}\left(1 - \frac{\alpha}{2}\right) \times SE(\bar{Y}) \end{aligned}\]
The critical value \(z_{1-\alpha/2} = \Phi^{-1}(1 - \alpha/2)\) is the \(1 - \alpha/2\) quantile of the standard normal
For a 95% interval, \(\alpha = 0.05\) and \(z_{0.975} \approx 1.96\) (qnorm(0.975) in R)
\[\Phi(z_{0.975}) = \int_{-\infty}^{z_{0.975}} \frac{1}{\sqrt{2\pi}} e^{-z^2/2}\,dz = 0.975 \quad \Longleftrightarrow \quad z_{0.975} = \Phi^{-1}(0.975)\]
\[P\left(-z \le \frac{\bar{Y} - \mu}{SE(\bar{Y})} \le z\right) \approx 2\Phi(z) - 1\]
Our two-sided \(100(1-\alpha)\%\) confidence interval is
\[ \left[\bar{Y} - z_{1-\alpha/2}\frac{\sigma}{\sqrt{n}},\ \ \bar{Y} + z_{1-\alpha/2}\frac{\sigma}{\sqrt{n}}\right]\]
Unfortunately, we don’t know \(\sigma\)! So let’s plug in our estimated \(\hat{\sigma}\) instead.
\[ \left[\bar{Y} - z_{1-\alpha/2}\widehat{SE}(\bar{Y}),\ \ \bar{Y} + z_{1-\alpha/2}\widehat{SE}(\bar{Y})\right], \qquad \widehat{SE}(\bar{Y}) = \frac{\hat{\sigma}}{\sqrt{n}}\]
Is this valid? Yes, by Slutsky’s theorem, if \(\hat{\sigma} \xrightarrow{p} \sigma\), then
\[ \frac{\bar{Y} - \mu}{\widehat{SE}(\bar{Y})} = \frac{\overbrace{\sqrt{n}(\bar{Y} - \mu)}^{\xrightarrow{d} \mathcal{N}(0, \sigma^2)}}{\underbrace{\hat{\sigma}}_{\xrightarrow{p} \sigma}} \xrightarrow{d} \frac{1}{\sigma}\mathcal{N}(0, \sigma^2) = \mathcal{N}(0, 1)\]
Our normalized mean with the estimated standard error is still asymptotically standard normal.
# A tibble: 1 × 4
est se lower upper
<dbl> <dbl> <dbl> <dbl>
1 2.28 0.807 0.699 3.86
Our 95% confidence interval for the average Dem \(-\) Rep difference is \([0.70, 3.86]\)
Interpretation: We are 95% confident that the true population difference in Dem vs. Rep thermometers is between \([0.70, 3.86]\)
This does not mean that there is a 95% probability that the true difference lies between \([0.70, 3.86]\)
Our 95% confidence interval from above is a large sample approximation
Even if our data were normally distributed, \(Y_i \overset{\text{i.i.d.}}{\sim} \mathcal{N}(\mu, \sigma^2)\), the asymptotic confidence interval is not quite exact
Getting exact coverage guarantees for our confidence intervals in a finite sample requires some additional assumptions.
Student (1908) showed that for normally distributed data, \(Y_i \overset{\text{i.i.d.}}{\sim} \mathcal{N}(\mu, \sigma^2)\) where \(\hat{\sigma^2}\) is the unbiased sample variance estimator:
\[T = \frac{\sqrt{n}(\bar{Y} - \mu)}{\hat{\sigma}} \sim t_{(n-1)} \]
\(t_{(n-1)}\) is the t-distribution with \(n-1\) “degrees of freedom”
The t distribution is the ratio of a standard normal and the square root of an independent chi-squared divided by its degrees of freedom.
\[T = \frac{\sqrt{n}(\bar{Y} - \mu)}{\hat{\sigma}} = \underbrace{\frac{\sqrt{n}(\bar{Y} - \mu)}{\sigma}}_{\text{Normal}(0, 1)} \times \left(\underbrace{\frac{(n-1)\hat{\sigma}^2}{\sigma^2}}_{\chi^2_{(n-1)}} \bigg/ (n-1)\right)^{-1/2} \]
The chi-squared distribution is the distribution of the sum of squared i.i.d. standard normals.
\(\bar{Y} \pm\) 1.960 \(\times \widehat{SE}(\bar{Y})\)
\(Y_i \overset{\text{i.i.d.}}{\sim} \text{Exponential}(1)\), 20,000 samples per \(n\)
Most of the time, researchers present two-sided and symmetric confidence intervals.
We could instead stack it all on one side and construct a one-sided confidence interval!
\[P( \theta \le u) = 1 - \alpha\]
For an asymptotically normal CI of the sample mean, this is just
\[u = \bar{Y} + z_{1-\alpha}\frac{\hat{\sigma}}{\sqrt{n}}\]
For a 95% interval, \(\alpha = 0.05\) and \(z_{0.95} \approx 1.645\) (qnorm(0.95) in R)
Given a particular null and alternative, we want to choose a test statistic that will be large if the null is false (and not too large if it is true).
Our most common test statistic is the t-statistic (esp. for tests based on asymptotic normality):
\[ T = \frac{\hat{\mu} - \mu_0}{\widehat{SE}(\hat{\mu})} \]
Ex. For testing the null of \(\mu = 0\) difference in Democratic v. Republican feeling thermometers using the sample mean estimator
\[ T = \frac{\bar{Y} - 0}{\hat{\sigma}/\sqrt{n}} \]
We’ve shown that under the null \(T\) is asymptotically standard normal
\[T \overset{a}{\sim} \mathcal{N}(0, 1) \]
| \(H_0\) true | \(H_0\) false | |
|---|---|---|
| Retain \(H_0\) | Correct | Type II error (false negative) |
| Reject \(H_0\) | Type I error (false positive) | Correct |
Once we know the distribution of the test statistic under the null, we need to decide what realizations of the test statistic will lead to a decision of rejecting \(H_0\)
To do this, we need to find the value \(c\) such that
\[Pr(-c \le T \le c) = 1 - \alpha\]
For a two-sided test, \(H_a: \mu \neq \mu_0\), we’ll allocate our “\(\alpha\) budget” symmetrically to both tails of the test statistic distribution
For an asymptotically standard normal test statistic, our critical values should look familiar
\[\begin{aligned} Pr(-c \le T \le c) &\approx \Phi(c) - \Phi(-c) && \small\color{#777777}{\text{difference of two CDFs}} \\ &= \Phi(c) - \left[1 - \Phi(c)\right] && \small\color{#777777}{\text{symmetry: } \Phi(-x) = 1 - \Phi(x)} \\ &= 2\Phi(c) - 1 \end{aligned}\]
Setting this equal to \(1 - \alpha\) and solving for \(c\)
\[\begin{aligned} 2\Phi(c) - 1 &= 1 - \alpha \\ \Phi(c) &= 1 - \frac{\alpha}{2} && \small\color{#777777}{\text{add 1, divide by 2}} \\ c &= \Phi^{-1}\left(1 - \frac{\alpha}{2}\right) = z_{1 - \alpha/2} && \small\color{#777777}{\text{apply the inverse CDF}} \end{aligned}\]
Reject \(H_0\) if \(|T| > z_{1-\alpha/2}\). For \(\alpha = 0.05\), reject if \(|T| > 1.96\) - the same critical value as our 95% confidence interval!
2*pnorm(-abs(T)) for a two-sided asymptotically normal test.Randall Munroe, “Significant,” xkcd.com/882 (CC BY-NC 2.5)
When testing multiple hypotheses, we want to control the global error rate of the full “family” of tests
One error rate we could target is family-wise error rate
\[\text{FWER} = P(\text{at least one rejection} | \text{All nulls are true}) \]
We can write this using the complement
\[\text{FWER} = 1 - P(\text{fail to reject all tests} | \text{All nulls are true})\]
If I have \(K\) independent tests where I reject each at the rate \(\alpha\), my FWER is
\[\begin{aligned} \text{FWER} &= 1 - P(\text{fail to reject all } K | \text{All nulls are true}) \\ &= 1 - \textstyle\prod_{k=1}^K P(\text{fail to reject } H_{0k} | H_{0k} \text{ true}) && \small\color{#777777}{\text{independence}} \\ &= 1 - \textstyle\prod_{k=1}^K (1 - \alpha) && \small\color{#777777}{\text{Type I error rate } \alpha} \\ &= 1 - (1 - \alpha)^K \end{aligned}\]
Uncorrected, our testing procedure fails to control the FWER at the target \(\alpha\)
One simple correction is to alter the rate that we reject each individual hypothesis so that the FWER remains at most \(\alpha\) even as we increase the number of tests we conduct.
Why does this work? Remember that the probability of the union is bounded by the sum of the component probabilities.
\[\begin{aligned} \text{FWER} &= P\left(\textstyle\bigcup_{k=1}^K \{\text{reject } H_{0k}\} \,\middle|\, \text{All nulls are true}\right) \\ &\le \textstyle\sum_{k=1}^K P(\text{reject } H_{0k} | H_{0k} \text{ true}) && \small\color{#777777}{\text{union bound}} \\ &\le K \times \frac{\alpha}{K} = \alpha && \small\color{#777777}{\text{each test at level } \alpha / K} \end{aligned}\]
Ex: \(K = 20\) tests at \(\alpha = 0.05\). We’d reject each null only if \(p < 0.0025\) - \(|T| > 3.02\) instead of \(1.96\)
An alternative approach is the Holm step-down procedure (Holm 1979)
The Holm testing approach:
The bar relaxes as we go - first step is just Bonferroni:
\[\underbrace{\frac{\alpha}{K}}_{k = 1}, \quad \underbrace{\frac{\alpha}{K - 1}}_{k = 2}, \quad \underbrace{\frac{\alpha}{K - 2}}_{k = 3}, \quad \dotsc, \quad \underbrace{\frac{\alpha}{1}}_{k = K}\]
Two equivalent ways to correct: shrink the threshold \((p_k < \alpha/K)\) or inflate the p-value \((K p_k < \alpha)\)
p.adjust(p, method = "holm") (or "bonferroni") returns adjusted p-values we can compare to \(\alpha\) as if it were a single test| Age group | ||||||
|---|---|---|---|---|---|---|
| All | 18–29 | 30–39 | 40–49 | 50–64 | 65+ | |
| (1) | (2) | (3) | (4) | (5) | (6) | |
| Dem − Rep gap | 2.28** | 3.77 | −0.97 | 4.54* | 1.07 | 4.68** |
| (0.81) | (2.19) | (1.90) | (1.89) | (1.70) | (1.60) | |
| N | 5,477 | 547 | 833 | 870 | 1,276 | 1,680 |
Estimates are mean Dem − Rep thermometer differences; standard errors in parentheses. Two-sided tests of H₀: μ = 0: * p < 0.05, ** p < 0.01, *** p < 0.001.
PS 812 - University of Wisconsin-Madison