$$ \newcommand{X}{} \newcommand{Y}{} % A hex digit after # inside a macro body is eaten by build-time expansion, so digit-leading hexes spell # via .
$$
National Supported Work was a 1970s employment program for people facing serious barriers to work, including former drug users, former offenders, and young school dropouts.
Our dataset contains 445 men, of whom 185 were assigned treatment and 260 control.
Our population for this calculation is these 445 participants.
Random assignment is—the way it happened here—literally sampling the treated group1
Because treatment was assigned without replacement, we need to adjust the standard error we used last class.
Both times we solve for n: how many treated men it takes to get inside plus or minus 500 dollars.
\begin{aligned} \widehat{\operatorname{se}}_n&=\frac{\hat\sigma}{\sqrt n}. \\[.35em] 1.96\frac{\hat\sigma}{\sqrt n}&\le 500. \\[.35em] 1.96\hat\sigma&\le 500\sqrt n. \\[.35em] \frac{1.96\hat\sigma}{500}&\le\sqrt n. \\[.35em] \left(\frac{1.96\hat\sigma}{500}\right)^2&\le n. \end{aligned}
About 952 treated men out of 2,290 participants.
\begin{aligned} \widehat{\operatorname{se}}_n&=\frac{\hat\sigma}{\sqrt n}\sqrt{\textcolor{hotpink}{\frac{N-n}{N-1}}}. \\[.35em] 1.96\frac{\hat\sigma}{\sqrt n}\sqrt{\textcolor{hotpink}{\frac{N-n}{N-1}}}&\le500. \\[.35em] 1.96\hat\sigma\sqrt{\textcolor{hotpink}{\frac{N-n}{N-1}}}&\le500\sqrt n. \\[.35em] \frac{1.96\hat\sigma}{500}\sqrt{\textcolor{hotpink}{\frac{N-n}{N-1}}}&\le\sqrt n. \\[.35em] \left(\frac{1.96\hat\sigma}{500}\right)^2\textcolor{hotpink}{\frac{N-n}{N-1}}&\le n. \end{aligned}
About 557 treated men out of 1,340 participants.2
At our 185 men the interval is plus or minus 1,134 dollars last class, plus or minus 868 dollars without replacement.
Same random mechanism as the homework.
Binary outcomes there; earnings here.
How close would count as success?
Does n=185 treated men give us enough power?
No. Only 64% of intervals lie entirely above orange.
Does n=229 treated men give us enough power?
No. Only 73% of intervals lie entirely above orange.
Does n=273 treated men give us enough power?
Yes. 80% of intervals lie entirely above orange.
Does n=546 treated men give us enough power?
Yes. And we can feel pretty confident we’ll get the evidence. 98% of intervals lie entirely above orange.
\begin{aligned} \text{Mean} - \textcolor{#ef476f}{0.84\,\text{SE}} &= \text{Standard} + \textcolor{#118ab2}{1.96\,\text{SE}}, \\[.35em] \text{and therefore}\qquad \text{Mean} &= \text{Standard} + 2.80\,\text{SE}. \end{aligned}
Substituting our standard error formula and rearranging:
\begin{aligned} 2.80\frac{\hat\sigma}{\sqrt n}\sqrt{\textcolor{hotpink}{\frac{N-n}{N-1}}}&\le\text{Mean}-\text{Standard}. \\[.35em] \left(\frac{2.80\hat\sigma}{\text{Mean}-\text{Standard}}\right)^2\textcolor{hotpink}{\frac{N-n}{N-1}}&\le n. \end{aligned}
To meet this standard, we choose our sample size so that the gap between the assumed mean and the standard is at least 2.80 standard errors.
For n satisfying that:4 n=273 treated men, with 80% of intervals entirely above orange.
\begin{aligned} \text{Mean} - \textcolor{#ef476f}{0.84\,\text{SE}} &= \text{Standard} + \textcolor{#118ab2}{1.65\,\text{SE}}, \\ \text{and therefore}\qquad \text{Mean} &= \text{Standard} + 2.49\,\text{SE}. \end{aligned}
To get that evidence 80% of the time, we choose our sample size so that the mean is at least 2.49 standard errors above the standard—about 2.5.
The 95% coverage and 80% power levels are conventions, including in clinical-trial guidance (FDA/ICH E9, §3.5).
Sometimes we want power to find evidence of futility.
The interval requirement
The power requirement
The sample-size requirement
\begin{aligned} \text{Mean} + \textcolor{#ef476f}{0.84\,\text{SE}} &= \text{Standard} - \textcolor{#118ab2}{1.96\,\text{SE}}, \\ \text{and therefore}\qquad \text{Mean} &= \text{Standard} - 2.80\,\text{SE}. \end{aligned}
We choose our sample size so that the gap between the standard and the assumed mean is at least 2.80 standard errors.
n=501 treated men: 80% of intervals lie entirely below orange.
Bias gives you power against the truth. It’s not a metaphor.
\underset{\text{coverage}}{\Pr(\text{covers green})} \;=\; 1-\underset{\text{power}}{\Pr(\text{doesn't cover green})}
Power isn’t really about the relationship between the green line and the orange one.
As the sampling distribution shifts away from the estimand…
When the bias has increased enough for the center of our estimates to reach the CPS mean, this happens.
Observed NSW earnings: blue treated, red controls.
Assignment schematic: now keep the controls.
n = 30. Intervals containing green in 2,000 simulated studies: 51%.
n = 60. Intervals containing green in 2,000 simulated studies: 19%.
n = 120. Intervals containing green in 2,000 simulated studies: 2%.
n = 185. Intervals containing green in 2,000 simulated studies: 0 of 2,000.
n = 500. Intervals containing green in 2,000 simulated studies: 0 of 2,000.
We’re sampling from the CPS population to estimate the NSW control population’s mean.
A bigger sample gives us a narrower interval around the wrong mean.
We just gave ourselves power against the truth.
\text{coverage}=1-\Pr(\text{interval excludes the truth}).
How much bias does it take to do this?
\text{coverage} = \int_{\mu-1.96\sigma}^{\mu+1.96\sigma} f(x) dx \qqtext{ where } f(x)=\frac{1}{\sqrt{2\pi} \sigma} e^{-\frac{(x-\tilde\mu)^2}{2\sigma^2}}
\begin{aligned} \text{coverage} &= \int_{\mu-1.96\sigma}^{\mu+1.96\sigma} \frac{1}{\sqrt{2\pi} \sigma} e^{-\frac{(x-\tilde\mu)^2}{2\sigma^2}} dx \\ &= \int_{-1.96-(\tilde\mu-\mu)/\sigma}^{1.96-(\tilde\mu-\mu)/\sigma} \frac{1}{\sqrt{2\pi} \sigma} e^{-\frac{u^2}{2}} \sigma du \\ &= \int_{-1.96-(\tilde\mu-\mu)/\sigma}^{1.96-(\tilde\mu-\mu)/\sigma} \textcolor{blue}{\frac{1}{\sqrt{2\pi}} e^{-\frac{u^2}{2}}} du \end{aligned}
Bias of half a standard error: \operatorname{pnorm}(1.46)-\operatorname{pnorm}(-2.46) = 92.09\% coverage.
Same comparison and bias, sixteen times as much data: if SE scales as 1/\sqrt n, it falls to one-quarter. Bias is now two SEs: \operatorname{pnorm}(-0.04)-\operatorname{pnorm}(-3.96) = 48.40\% coverage.
\small{ \begin{aligned} \text{coverage} &=\int_{-1.96-\frac{\text{bias}}{\text{se}}}^{+1.96-\frac{\text{bias}}{\text{se}}} \frac{1}{\sqrt{2\pi}} e^{-\frac{u^2}{2}} du \\ &= \int_{-\infty}^{+1.96-\frac{\text{bias}}{\text{se}}} \frac{1}{\sqrt{2\pi}} e^{-\frac{u^2}{2}} du \ - \ \int_{-\infty}^{-1.96-\frac{\text{bias}}{\text{se}}} \frac{1}{\sqrt{2\pi}} e^{-\frac{u^2}{2}} du \end{aligned} }
\frac{\text{bias}}{\text{se}} = \frac{1}{2} \quad \implies \quad \text{coverage} = 92\%
\frac{\text{bias}}{\text{se}} = 1 \quad \implies \quad \text{coverage} = 83\%
\frac{\text{bias}}{\text{se}} = 2 \quad \implies \quad \text{coverage} = 48\%
\frac{\text{bias}}{\text{se}} = 3 \quad \implies \quad \text{coverage} = 15\%
Suppose we’ve got bias, but only a little bit.
We’re doing a pilot study with sample size n=100.
And we’re sure that our estimator’s absolute bias is less than half its standard error.
Question 1. What’s the coverage of our 95% confidence intervals?
Reference points: nominal · questionable · coinflip
\text{two-sided power}=1-\text{coverage}(d),\qquad d=\frac{\text{estimator center}-\text{reference line}}{\text{se}}.
Age · Years of schooling · Black · Hispanic · Married · Finished high school.
NSW controls · rough CPS peers
About 80% power against orange at 501 men.
This is why we do experiments. Stay tuned.
We’ll return to these two NSW outcome lists when we formalize potential outcomes and ask what the randomized comparison tells us about the program.
McShane, Gal, Gelman, Robert, and Tackett, Abandon Statistical Significance, §2.2
Observed NSW controls (260).
Observed CPS subgroup (286).
The target: our constructed population of NSW controls. Its known mean is 4,555 dollars.
The data: samples with replacement from the CPS subgroup’s empirical distribution. Its mean is 7,103 dollars.
\begin{aligned} \textcolor{hotpink}{\frac{N-n}{N-1}}&=\frac{n/f-n}{n/f-1}. \\[.35em] &=\frac{n-nf}{n-f}. \\[.35em] &=\frac{n(1-f)}{n-f}. \end{aligned}
\begin{aligned} \left(\frac{1.96\hat\sigma}{500}\right)^2\frac{n(1-f)}{n-f}&\le n. \\[.35em] \left(\frac{1.96\hat\sigma}{500}\right)^2\frac{1-f}{n-f}&\le 1. \\[.35em] \left(\frac{1.96\hat\sigma}{500}\right)^2(1-f)&\le n-f. \\[.35em] \left(\frac{1.96\hat\sigma}{500}\right)^2(1-f)+f&\le n. \end{aligned}
Think of two outcome lists for the same NSW participants: earnings with the program and earnings without it. Random assignment reveals a sample from each list. We’ll formalize this later using potential outcomes.
The pink factor leaves an n on both sides. Drop it and you get an overestimate. Or we can solve for n in terms of the treatment fraction and everything else, easily: appendix.
Andrew Gelman and John Carlin (2014), Beyond Power Calculations: Assessing Type S (Sign) and Type M (Magnitude) Errors, p. 642. They describe using a previous study’s estimated effect in prospective power planning and caution that preliminary estimates may exaggerate effects.
Same n on both sides as before, and it solves the same way: appendix.