
Previous posts of mine have pointed out that summing the estimated effects of treatments selected from online experiments can exaggerate the sum of their true effects. Why does this happen, and can we describe it analytically?
Suppose we have \(K\) experiments, indexed by \(k=1,\ldots,K\). Throughout, we assume:
- Each experiment has a fixed true effect \(\theta_k\) and an estimate \(\hat\theta_k = \theta_k + \varepsilon_k\), where \(E[\varepsilon_k]=0\) and \(\operatorname{Var}(\varepsilon_k)=s_k^2\).
- Each standard error \(s_k>0\) is known, or estimated precisely enough to treat it as known.
- We ship the treatment from experiment \(k\) when \(\hat\theta_k > 2s_k\). This is approximately the positive-side threshold for a two-sided test at the 5% significance level.
- For the truncated-normal calculation, we assume \(\varepsilon_k\sim\mathcal{N}(0,s_k^2)\). In A/B tests, the central limit theorem can motivate this as an approximation for sufficiently large samples under suitable regularity conditions; it does not guarantee an exact normal distribution.
We do not need to assume that the experiments are independent.
The effect of selection
Let \(I_k=1\) if we ship the treatment from experiment \(k\), and let \(I_k=0\) otherwise. The sum of the true effects of the selected treatments is
\[ T = \sum_{k=1}^K I_k\theta_k, \]
but since the true effects are unknown, we compute
\[ \hat T = \sum_{k=1}^K I_k\hat\theta_k. \]
Both sums depend on which treatments are selected. Their expected difference is
\[ \begin{align} E[\hat T-T] &= E\left[\sum_{k=1}^K I_k(\hat\theta_k-\theta_k)\right] \\ &= \sum_{k=1}^K E[I_k\varepsilon_k] \\ &= \sum_{k=1}^K E[\varepsilon_k\mid I_k=1]\Pr(I_k=1). \end{align} \]
The last expression applies when each selection probability is positive. Although each estimate is unbiased before selection, its error need not have mean zero among selected treatments. The simulation below illustrates this: it draws a new set of true effects in each repetition, then generates estimates conditional on those effects.
Normally distributed errors
Under the normal error assumption, we can calculate the bias for any fixed true effects. Write \(\varepsilon_k=s_kz_k\), where \(z_k\sim\mathcal{N}(0,1)\), and define the standardized estimate
\[ Z_k = \frac{\hat\theta_k}{s_k} = \frac{\theta_k}{s_k}+z_k. \]
The selection rule \(Z_k>2\) is equivalent to \(z_k>2-\theta_k/s_k\). The mean of a standard normal variable truncated below this threshold is
\[ E\left[z_k\mid I_k=1\right] = \frac{\phi(2-\theta_k/s_k)}{1-\Phi(2-\theta_k/s_k)}, \]
where \(\phi\) and \(\Phi\) are the standard normal density and cumulative distribution function. On the original scale, the expected error among selected treatments is therefore
\[ E\left[\varepsilon_k\mid I_k=1\right] = s_k\frac{\phi(2-\theta_k/s_k)}{1-\Phi(2-\theta_k/s_k)} > 0. \]
Since \(\Pr(I_k=1)=1-\Phi(2-\theta_k/s_k)\), the expected difference between the estimated and true sums is
\[ E[\hat T-T] = \sum_{k=1}^K s_k\phi(2-\theta_k/s_k) > 0. \]
How do I explain this without algebra?
This figure from an earlier post illustrates selection for a single experiment. An experiment draws from the distribution in blue, but we keep those draws that are large enough to be in the shaded region; the region under the blue curve that is not shaded would not be considered “statistically significant”. The average of the shaded region is not the same of the average of the blue curve; the average of the shaded region is slightly larger. Hence, statistically significant estimates from experiments are generally biased upwards, and stacking these estimates as we do when constructing \(\hat T\) simply allows that bias to compound.
