$$ \newcommand{X}{} \newcommand{Y}{} % A hex digit after # inside a macro body is eaten by build-time expansion, so digit-leading hexes spell # via .
$$
Sampling with replacement
Sampling without replacement
We now have three ways to calibrate an interval estimate.
The normal distribution is a parametric family of distributions involving two parameters.
We say a random variable X is normally distributed with mean \theta and standard deviation \sigma …
… if the probability that it’s in an interval [a,b] is given by this integral of its probability density. P_{\theta,\sigma}(X \in [a,b]) = \int_a^b f_{\theta,\sigma}(x)dx \qfor f_{\theta, \sigma}(x) = \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\theta)^2}{2\sigma^2}}
We have to talk about the probability that it’s ‘in an interval’ rather than that it ‘takes a value’ because …
… the probability it actually takes on any particular value is x zero: it’s an integral from x to x.
The Central Limit Theorem
The sampling distribution of a mean of independent random variables, \color{#404040}\frac{1}{n}\sum\limits_{i=1}^n X_i, gets arbitrarily close to its normal approximation
as the number of random variables \color{#404040}n increases to infinity.
Caveats.
\text{interval estimate} = \hat\theta \pm 1.96 \hat\sigma
This works if three things are true.
\begin{aligned} \text{normal approximation} & \ f_{\theta,\sigma}(x) \qfor \sigma^2 = \frac{\theta(1-\theta)}{n} \\ \text{corresponding estimate} & \ f_{\hat\theta, \hat \sigma}(x) \qfor \hat\sigma^2 = \frac{\hat \theta(1-\hat \theta)}{n}. \end{aligned}
\begin{aligned} \text{normal approximation} & \ f_{\theta,\sigma}(x) \qfor \sigma^2 = \frac{\theta(1-\theta)}{n} \times \frac{m-n}{m-1} \\ \text{corresponding estimate} & \ f_{\hat\theta, \hat \sigma}(x) \qfor \hat\sigma^2 = \frac{\hat \theta(1-\hat \theta)}{n} \times \frac{m-n}{m-1}. \end{aligned}
\begin{aligned} \text{normal approximation} & \ f_{\mu,\sigma_n}(x) \qfor \sigma_n^2 = \frac{\sigma_H^2}{n} \qqtext{for} \sigma_H^2 = \frac{1}{m}\sum_{j=1}^m (h_j - \mu)^2 \\ \text{corresponding estimate} & \ f_{\bar H_n, \hat \sigma_n}(x) \qfor \hat\sigma_n^2 = \frac{\hat\sigma_H^2}{n} \qqtext{for} \hat\sigma_H^2 = \frac{1}{n}\sum_{i=1}^n (H_i - \bar H_n)^2. \end{aligned}
\begin{aligned} \textcolor{red}{\text{binomial interval}} &= 0.6800 \pm 0.0368 \\ \textcolor{blue}{\text{normal interval}} &= 0.6800 \pm 0.0366 \end{aligned}
\hat \theta \pm 1.96\sigma_n \qfor \sigma_n = \sqrt{\frac{\theta (1-\theta)}{n}} \qqtext{ is } \hat\theta \pm .01 \qqtext{if} 1.96\sqrt{\frac{\theta (1-\theta)}{n}} = .01
n = \frac{1.96^2 \ \hat\theta (1-\hat\theta)}{.01^2} \approx 8000
\begin{aligned} \pm 0.037 &= \pm 1.96\hat\sigma_{625} \qfor \hat\sigma_{625} = \sqrt{\frac{\hat\theta (1-\hat\theta)}{625}} \\ \pm 0.01 &= \pm 1.96\hat\sigma_{n} \qfor \hat\sigma_{n} = \sqrt{\frac{\hat\theta (1-\hat\theta)}{n}} \end{aligned}
\frac{0.037}{.01} = \frac{1.96\hat\sigma_{625}}{1.96\hat\sigma_n} = \frac{\sqrt{\frac{\hat\theta (1-\hat\theta)}{625}}}{\sqrt{\frac{\hat\theta (1-\hat\theta)}{n}}} = \sqrt{\frac{n}{625}} \qqtext{ so } n = 625\left(\frac{0.037}{.01}\right)^2 \approx 8000
What do we do if we don’t have any data yet?
But we can still use the formula we worked out earlier to get somewhere. 1.96\sqrt{\frac{\theta (1-\theta)}{n}} = .01 \qqtext{so} n = \frac{1.96^2 \ \theta (1-\theta)}{.01^2}
We don’t have an estimate of \theta, but we do know it’s between 0 and 1. And, consequently, so is \theta(1-\theta).
So we know that if we just substitute 1 into our formula, we’ll get a number that’s bigger than we need.
n < n' = \frac{1.96^2 \cdot 1}{.01^2} \approx 38400
That’s a bit excessive. In fact, we can substitute in 1/4 instead of 1. n < n' = \frac{1.96^2 \cdot 1/4}{.01^2} \approx 9600
Much better. That’s pretty close to the number we got with preliminary data.
Here’s the claim. Why is it true? n := \frac{1.96^2 \ \theta (1-\theta)}{.01^2} < n' := \frac{1.96^2 \ \times 1/4}{.01^2}
Hint. Look at the graph of f(x) = x(1-x) above.
The NSW Experiment
| n | \hat \mu | sample SD |
|---|---|---|
| 185 | 6300 | 7900 |
\begin{aligned} \mu &\in 6300 \pm 1100 \approx [5200, \ 7500] &&\qqtext{is a 95\% confidence interval in 1978 dollars} \\ &\in 31700 \pm 5600 \approx [26100, \ 37400] &&\qqtext{adjusted for inflation} \end{aligned}
| n | \hat \mu | sample SD |
|---|---|---|
| 185 | 6300 | 7900 |
Figure 22
\hat\mu \pm 1.96\hat\sigma_n \qfor \hat\sigma_n = \frac{\hat\sigma_Y}{\sqrt{n}} \qqtext{ is } \hat\mu \pm 500 \qqtext{if} 1.96\frac{\hat\sigma_Y}{\sqrt{n}} = 500
n = \frac{1.96^2 \ \hat\sigma_Y^2}{500^2} \approx 950
\begin{aligned} \pm 1130 &= \pm 1.96\hat\sigma_{185} \qfor \hat\sigma_{185} = \frac{\hat\sigma_Y}{\sqrt{185}} \\ \pm 500 &= \pm 1.96\hat\sigma_n \qfor \hat\sigma_n = \frac{\hat\sigma_Y}{\sqrt{n}} \end{aligned}
\frac{1130}{500} = \frac{1.96\hat\sigma_{185}}{1.96\hat\sigma_n} = \sqrt{\frac{n}{185}} \qqtext{ so } n = 185\left(\frac{1130}{500}\right)^2 \approx 950