Practice / Probability for ML

Hypothesis tests and p-values: z and t tests, power and multiple comparisons

Ten problems on hypothesis tests: a one-sample z test on a latency benchmark with its two-sided p-value, one-sided against two-sided tests and why the side is chosen first, the confidence interval as the set of nulls a test keeps, a t test on nine measurements with the t critical value, an A/B test of two conversion rates with the pooled standard error, the power of a test against a given effect, the sample size for 80% power, McNemar's test for two classifiers scored on the same examples, the false-positive rate of twenty tests and the Bonferroni fix, and an exact permutation test on three runs per model, with worked solutions and the mistakes of reading the p-value as the probability that the null is true, choosing the side after seeing the data, using z instead of t on a small sample, taking one group's standard error for a difference, and testing twenty metrics and reporting the one that passed.

Before you start

A hypothesis test asks whether the data are surprising if nothing interesting is going on. The "nothing interesting" is the null hypothesis H0H_0: the new model is no faster, the new button converts no better, the two classifiers are equally accurate. The test turns the data into one statistic whose distribution under H0H_0 is known, usually a standard normal or a tt distribution because of the central limit theorem, and the p-value is the probability, computed as if H0H_0 were true, of a statistic at least as extreme as the one observed. A small p-value says the data would be unusual under H0H_0; it does not say how likely H0H_0 is, and a large one does not say the effect is zero. These ten problems run the z test, the t test, the two-proportion test behind every A/B test and the paired test behind every model comparison by hand, then work out power, sample size, the cost of running many tests at once, and an exact test that needs no normal approximation at all.

  • The recipe. State H0H_0 and the alternative H1H_1, and pick the level α\alpha (usually 0.050.05) before looking at the data. Compute a test statistic, find its p-value under H0H_0, and reject H0H_0 when p≤αp \le \alpha.
  • z test for a mean with known σ\sigma: z=(xˉ−μ0)/(σ/n)z = (\bar x - \mu_0)/(\sigma/\sqrt n). Two-sided, p=2(1−Φ(∣z∣))p = 2\big(1 - \Phi(\lvert z\rvert)\big); one-sided for H1:μ>μ0H_1: \mu > \mu_0, p=1−Φ(z)p = 1 - \Phi(z). The two-sided 5%5\% cutoff is ∣z∣>1.96\lvert z\rvert > 1.96, the one-sided one z>1.645z > 1.645.
  • t test when σ\sigma is estimated by the sample standard deviation ss: t=(xˉ−μ0)/(s/n)t = (\bar x - \mu_0)/(s/\sqrt n) has a tt distribution with n−1n - 1 degrees of freedom, whose tails are heavier than the normal's. For 88 degrees of freedom the two-sided 5%5\% cutoff is 2.3062.306.
  • Two proportions. For p^1=x1/n1\hat p_1 = x_1/n_1 and p^2=x2/n2\hat p_2 = x_2/n_2 under H0:p1=p2H_0: p_1 = p_2, pool them, p^=(x1+x2)/(n1+n2)\hat p = (x_1 + x_2)/(n_1 + n_2), and use z=(p^2−p^1)/p^(1−p^)(1/n1+1/n2)z = (\hat p_2 - \hat p_1)\big/\sqrt{\hat p(1 - \hat p)(1/n_1 + 1/n_2)}.
  • Confidence interval duality. A two-sided test at level α\alpha rejects μ0\mu_0 exactly when μ0\mu_0 lies outside the 1−α1 - \alpha confidence interval xˉ±zα/2 σ/n\bar x \pm z_{\alpha/2}\,\sigma/\sqrt n.
  • Errors and power. A type I error rejects a true H0H_0, and happens with probability α\alpha. A type II error keeps a false one. The power is the probability of rejecting when a specific alternative is true. For a two-sided z test with true shift δ\delta standard errors, power =Φ(δ−1.96)+Φ(−δ−1.96)= \Phi(\delta - 1.96) + \Phi(-\delta - 1.96).
  • Sample size for power 1−β1 - \beta against a difference Δ\Delta: n=((zα/2+zβ) σ/Δ)2n = \big((z_{\alpha/2} + z_\beta)\,\sigma/\Delta\big)^2, rounded up. For 5%5\% two-sided and 80%80\% power, zα/2+zβ=1.96+0.8416z_{\alpha/2} + z_\beta = 1.96 + 0.8416.
  • Many tests. With mm independent true nulls each tested at α\alpha, Pr⁡(at least one rejection)=1−(1−α)m\Pr(\text{at least one rejection}) = 1 - (1 - \alpha)^m. Bonferroni tests each at α/m\alpha/m, which keeps that probability at most α\alpha.

Builds on: Sampling distributions and the central limit theorem: standard errors, confidence intervals and the √N rule, Continuous random variables: densities, CDFs, expectation and the uniform, exponential and normal, Discrete random variables: expectation, variance and the binomial, geometric and Poisson

Problems

  1. ·

    A serving stack is documented at a mean latency of 200200 ms with a standard deviation of 3030 ms. After an update, 3636 requests average 210210 ms. Test H0:μ=200H_0: \mu = 200 against H1:μ≠200H_1: \mu \ne 200 at the 5%5\% level, assuming σ=30\sigma = 30 is unchanged.

  2. ·

    For the data of Problem 1, find the p-value of the one-sided test of H1:μ>200H_1: \mu > 200. Then suppose the sample mean had been 209209 ms instead, so z=1.8z = 1.8: find the one-sided and two-sided p-values, and say which one may be reported.

  3. ··

    For the data of Problem 1, find the 95%95\% confidence interval for μ\mu. Use it to decide, without computing a new statistic, whether a two-sided 5%5\% test rejects μ0=200\mu_0 = 200 and μ0=205\mu_0 = 205, and check the second with its p-value.

  4. ··

    Nine runs of a training job take xˉ=10.6\bar x = 10.6 hours on average, with sample standard deviation s=1.5s = 1.5 hours. The previous version averaged 9.59.5 hours. Test H0:μ=9.5H_0: \mu = 9.5 against H1:μ≠9.5H_1: \mu \ne 9.5 at the 5%5\% level.

  5. ··

    In an A/B test, 200200 of 20002000 users convert with the old checkout and 240240 of 20002000 with the new one. Test whether the conversion rates differ, two-sided at 5%5\%.

  6. ··

    For the test of Problem 1 (n=36n = 36, σ=30\sigma = 30, two-sided 5%5\%), find the probability of a type I error, and the power if the true mean latency is 212212 ms.

  7. ··

    How many requests are needed for the test of Problem 1 to have 80%80\% power against a 1212 ms change in mean latency, still two-sided at 5%5\% with σ=30\sigma = 30? Check the power at that nn.

  8. ···

    Two classifiers are scored on the same 500500 test examples. Both are right on 400400, both wrong on 4040, only A is right on 4040 and only B is right on 2020. Test whether their accuracies differ with McNemar's test, using the normal approximation and the exact binomial version, and compare with an unpaired two-proportion test.

  9. ··

    A team tracks 2020 metrics in an experiment where, in fact, nothing changed, and tests each at the 5%5\% level, independently. Find the probability that at least one metric comes out significant and the expected number that do. Repeat with the Bonferroni level, and say whether a metric with p=0.004p = 0.004 survives it.

  10. ···

    Three seeds of model A score 1212, 1414 and 1515; three seeds of model B score 99, 1010 and 1313. Run an exact permutation test of whether A scores higher, using the difference in mean scores, one-sided and two-sided. What is the smallest p-value this design can produce?

Worked solutions

Problem 1

A serving stack is documented at a mean latency of 200200 ms with a standard deviation of 3030 ms. After an update, 3636 requests average 210210 ms. Test H0:μ=200H_0: \mu = 200 against H1:μ≠200H_1: \mu \ne 200 at the 5%5\% level, assuming σ=30\sigma = 30 is unchanged.

  1. σ/n=30/6=5\sigma/\sqrt{n} = 30/6 = 5The standard error of the mean of 3636 requests.
  2. z=(210−200)/5=2z = (210 - 200)/5 = 2The sample mean is two standard errors above the null value.
  3. 1−Φ(2)≈0.022751 - \Phi(2) \approx 0.02275The upper tail of the standard normal beyond 22.
  4. p=2(1−Φ(2))≈0.0455p = 2(1 - \Phi(2)) \approx 0.0455Two-sided: a mean of 190190 ms would have been just as surprising, so both tails count.
  5. z=2z = 2, p≈0.0455<0.05p \approx 0.0455 < 0.05: reject H0H_0; the update changed the mean latencyEquivalently, ∣z∣=2>1.96\lvert z\rvert = 2 > 1.96. The p-value is the chance of data this extreme if the mean were still 200200 ms, not the chance that it is 200200 ms (Mistake 1).

Problem 2

For the data of Problem 1, find the p-value of the one-sided test of H1:μ>200H_1: \mu > 200. Then suppose the sample mean had been 209209 ms instead, so z=1.8z = 1.8: find the one-sided and two-sided p-values, and say which one may be reported.

  1. pone=1−Φ(2)≈0.0228p_{\text{one}} = 1 - \Phi(2) \approx 0.0228Only the upper tail counts when H1H_1 says the mean went up.
  2. z=(209−200)/5=1.8z = (209 - 200)/5 = 1.8The new sample mean.
  3. ptwo=2(1−Φ(1.8))≈0.0719p_{\text{two}} = 2(1 - \Phi(1.8)) \approx 0.0719Not significant at 5%5\%.
  4. pone=1−Φ(1.8)≈0.0359p_{\text{one}} = 1 - \Phi(1.8) \approx 0.0359Significant at 5%5\%, if the one-sided test had been chosen.
  5. p=0.0228p = 0.0228 one-sided for z=2z = 2; for z=1.8z = 1.8, 0.03590.0359 one-sided and 0.07190.0719 two-sided. The one-sided value is valid only if H1:μ>200H_1: \mu > 200 was fixed before the data were seenA one-sided test is right when only one direction matters, such as "is it slower?". Picking the side that the data happen to favor doubles the false-positive rate (Mistake 2).

Problem 3

For the data of Problem 1, find the 95%95\% confidence interval for μ\mu. Use it to decide, without computing a new statistic, whether a two-sided 5%5\% test rejects μ0=200\mu_0 = 200 and μ0=205\mu_0 = 205, and check the second with its p-value.

  1. 1.96⋅5=9.81.96 \cdot 5 = 9.8The margin of error: 1.961.96 standard errors.
  2. 210±9.8=[200.2, 219.8]210 \pm 9.8 = [200.2,\ 219.8]The 95%95\% confidence interval.
  3. 200∉[200.2, 219.8]200 \notin [200.2,\ 219.8]So the test rejects μ0=200\mu_0 = 200, as in Problem 1.
  4. 205∈[200.2, 219.8]205 \in [200.2,\ 219.8]So the test keeps μ0=205\mu_0 = 205.
  5. The interval is [200.2,219.8][200.2, 219.8]: it rejects 200200 and keeps 205205. For 205205, z=(210−205)/5=1z = (210 - 205)/5 = 1 and p=2(1−Φ(1))≈0.317p = 2(1 - \Phi(1)) \approx 0.317The interval is exactly the set of null values a two-sided 5%5\% test would keep, and it also says how big the change plausibly is, which the p-value does not.

Problem 4

Nine runs of a training job take xˉ=10.6\bar x = 10.6 hours on average, with sample standard deviation s=1.5s = 1.5 hours. The previous version averaged 9.59.5 hours. Test H0:μ=9.5H_0: \mu = 9.5 against H1:μ≠9.5H_1: \mu \ne 9.5 at the 5%5\% level.

  1. s/n=1.5/3=0.5s/\sqrt{n} = 1.5/3 = 0.5The estimated standard error.
  2. t=(10.6−9.5)/0.5=2.2t = (10.6 - 9.5)/0.5 = 2.2The statistic, with σ\sigma replaced by ss.
  3. df=n−1=8\text{df} = n - 1 = 8, cutoff t0.025,8≈2.306t_{0.025, 8} \approx 2.306Estimating σ\sigma from nine runs adds uncertainty, so the tt cutoff is wider than 1.961.96.
  4. p=2Pr⁡(T8>2.2)≈0.059p = 2\Pr(T_8 > 2.2) \approx 0.059The two tails of the tt distribution with 88 degrees of freedom beyond ±2.2\pm2.2.
  5. t=2.2<2.306t = 2.2 < 2.306 and p≈0.059>0.05p \approx 0.059 > 0.05: do not reject at the 5%5\% levelThe evidence that the job got slower is suggestive, not conclusive. Treating 2.22.2 as a z statistic gives p≈0.028p \approx 0.028 and the opposite conclusion (Mistake 3).

Problem 5

In an A/B test, 200200 of 20002000 users convert with the old checkout and 240240 of 20002000 with the new one. Test whether the conversion rates differ, two-sided at 5%5\%.

  1. p^1=0.10\hat p_1 = 0.10, p^2=0.12\hat p_2 = 0.12, difference 0.020.02Two percentage points.
  2. p^=440/4000=0.11\hat p = 440/4000 = 0.11Under H0H_0 the rates are equal, so pool all 40004000 users to estimate the common rate.
  3. p^(1−p^)=0.11⋅0.89=0.0979\hat p(1 - \hat p) = 0.11 \cdot 0.89 = 0.0979The Bernoulli variance at the pooled rate.
  4. SE=0.0979 (1/2000+1/2000)≈0.00989\text{SE} = \sqrt{0.0979\,(1/2000 + 1/2000)} \approx 0.00989The variance of a difference of independent estimates is the sum of their variances.
  5. z=0.02/0.00989≈2.02z = 0.02/0.00989 \approx 2.02 and p≈0.043p \approx 0.043: the new checkout converts better, just significantlyThe unpooled standard error 0.1⋅0.9/2000+0.12⋅0.88/2000\sqrt{0.1\cdot0.9/2000 + 0.12\cdot0.88/2000} is also about 0.009890.00989 here, so the choice barely matters at these sizes. Using one group's standard error alone gives z≈2.86z \approx 2.86 (Mistake 4).

Problem 6

For the test of Problem 1 (n=36n = 36, σ=30\sigma = 30, two-sided 5%5\%), find the probability of a type I error, and the power if the true mean latency is 212212 ms.

  1. Pr⁡(type I)=α=0.05\Pr(\text{type I}) = \alpha = 0.05By construction: under H0H_0, ∣Z∣>1.96\lvert Z\rvert > 1.96 has probability 0.050.05.
  2. Reject when xˉ>209.8\bar x > 209.8 or xˉ<190.2\bar x < 190.2200±1.96⋅5200 \pm 1.96\cdot5, the cutoffs on the scale of the sample mean.
  3. Pr⁡(xˉ>209.8)=Φ((212−209.8)/5)=Φ(0.44)\Pr(\bar x > 209.8) = \Phi\big((212 - 209.8)/5\big) = \Phi(0.44)Under the alternative, xˉ∼N(212,52)\bar x \sim N(212, 5^2).
  4. Φ(0.44)≈0.670\Phi(0.44) \approx 0.670 and Pr⁡(xˉ<190.2)=Φ(−4.36)≈7×10−6\Pr(\bar x < 190.2) = \Phi(-4.36) \approx 7\times10^{-6}The lower tail is negligible.
  5. Type I error 0.050.05; power ≈0.670\approx 0.670The same as Φ(δ−1.96)+Φ(−δ−1.96)\Phi(\delta - 1.96) + \Phi(-\delta - 1.96) with δ=12/5=2.4\delta = 12/5 = 2.4. A real 1212 ms slowdown is missed one time in three, so a p-value above 0.050.05 from this design is weak evidence of no change.

Problem 7

How many requests are needed for the test of Problem 1 to have 80%80\% power against a 1212 ms change in mean latency, still two-sided at 5%5\% with σ=30\sigma = 30? Check the power at that nn.

  1. zα/2=1.96z_{\alpha/2} = 1.96, zβ=0.8416z_\beta = 0.8416Φ(0.8416)≈0.80\Phi(0.8416) \approx 0.80.
  2. (1.96+0.8416)⋅30/12≈7.004(1.96 + 0.8416)\cdot30/12 \approx 7.004The number of standard deviations of the data the effect must be, scaled up.
  3. n=7.0042≈49.06n = 7.004^2 \approx 49.06The formula ((zα/2+zβ)σ/Δ)2\big((z_{\alpha/2} + z_\beta)\sigma/\Delta\big)^2.
  4. n=50n = 50Round up: 4949 requests fall just short of 80%80\%.
  5. n=50n = 50; then δ=12/(30/50)≈2.83\delta = 12/(30/\sqrt{50}) \approx 2.83 and the power is Φ(2.83−1.96)≈0.807\Phi(2.83 - 1.96) \approx 0.807Halving the effect to detect quadruples the sample size, since nn grows like 1/Δ21/\Delta^2.

Problem 8

Two classifiers are scored on the same 500500 test examples. Both are right on 400400, both wrong on 4040, only A is right on 4040 and only B is right on 2020. Test whether their accuracies differ with McNemar's test, using the normal approximation and the exact binomial version, and compare with an unpaired two-proportion test.

  1. Accuracies 440/500=0.88440/500 = 0.88 and 420/500=0.84420/500 = 0.84A is right on 400+40400 + 40, B on 400+20400 + 20.
  2. Only the 6060 disagreements carry informationOn the 440440 examples where the models agree, the difference in accuracy is 00. Under H0H_0, each disagreement favors A with probability 12\tfrac12.
  3. z=(40−20)/60≈2.58z = (40 - 20)/\sqrt{60} \approx 2.58, so p≈0.0098p \approx 0.0098Under H0H_0, A's wins are Bin(60,12)\text{Bin}(60, \tfrac12), with mean 3030 and standard deviation 15\sqrt{15}; (40−30)/15(40 - 30)/\sqrt{15} is the same zz.
  4. Exact: p=2Pr⁡(Bin(60,12)≥40)≈0.0135p = 2\Pr(\text{Bin}(60, \tfrac12) \ge 40) \approx 0.0135The normal approximation is a little optimistic here.
  5. McNemar: z≈2.58z \approx 2.58, p≈0.010p \approx 0.010 (exact 0.0130.013), so A is more accurate. The unpaired test gives z≈1.82z \approx 1.82, p≈0.068p \approx 0.068The unpaired test treats the two accuracies as independent samples, but they come from the same examples. Pairing removes the shared difficulty of the examples, which is why it is the right test, and the more powerful one.

Problem 9

A team tracks 2020 metrics in an experiment where, in fact, nothing changed, and tests each at the 5%5\% level, independently. Find the probability that at least one metric comes out significant and the expected number that do. Repeat with the Bonferroni level, and say whether a metric with p=0.004p = 0.004 survives it.

  1. Pr⁡(no false positives)=0.9520≈0.358\Pr(\text{no false positives}) = 0.95^{20} \approx 0.358Each true null is kept with probability 0.950.95, independently.
  2. 1−0.9520≈0.6421 - 0.95^{20} \approx 0.642At least one false positive is more likely than not.
  3. 20⋅0.05=120\cdot0.05 = 1The expected number of false positives, by linearity, independent or not.
  4. 0.05/20=0.00250.05/20 = 0.0025, and 1−0.997520≈0.04881 - 0.9975^{20} \approx 0.0488Bonferroni: test each metric at α/m\alpha/m.
  5. Pr⁡(at least one)≈0.64\Pr(\text{at least one}) \approx 0.64 and one false positive expected; with Bonferroni, 0.0488≤0.050.0488 \le 0.05. The metric with p=0.004p = 0.004 does not survive, since 0.004>0.00250.004 > 0.0025Bonferroni holds the chance of any false alarm at 5%5\% even when the tests are dependent, at the price of power (Mistake 5).

Problem 10

Three seeds of model A score 1212, 1414 and 1515; three seeds of model B score 99, 1010 and 1313. Run an exact permutation test of whether A scores higher, using the difference in mean scores, one-sided and two-sided. What is the smallest p-value this design can produce?

  1. Observed difference: 41/3−32/3=341/3 - 32/3 = 3The two groups' means.
  2. There are (63)=20\binom63 = 20 ways to label three of the six scores "A"Under H0H_0 the labels are exchangeable, so each split is equally likely.
  3. Splits with mean difference at least 33: {13,14,15}\{13, 14, 15\} and {12,14,15}\{12, 14, 15\}The difference is at least 33 exactly when the "A" scores sum to at least 4141, since the total is 7373.
  4. Splits at least 33 apart in either direction: those two and their mirror images {9,10,12}\{9, 10, 12\}, {9,10,13}\{9, 10, 13\}Sums at most 3232.
  5. One-sided p=2/20=0.10p = 2/20 = 0.10, two-sided p=4/20=0.20p = 4/20 = 0.20; the smallest possible one-sided p-value is 1/20=0.051/20 = 0.05Three seeds per model can never reach significance below 0.050.05, however large the gap. The test is exact: no normal approximation or equal-variance assumption is needed.

Where this goes wrong

1. The p-value read as the probability that the null is true

A p-value of 0.04550.0455 invites the sentence "there is only a 4.6%4.6\% chance the update did nothing".

  1. p=Pr⁡(data this extreme∣H0)≈0.0455p = \Pr(\text{data this extreme} \mid H_0) \approx 0.0455Right so far: Problem 1.
  2. “So Pr⁡(H0∣data)≈0.0455\Pr(H_0 \mid \text{data}) \approx 0.0455.”That flips the conditional. Getting Pr⁡(H0∣significant)\Pr(H_0 \mid \text{significant}) needs Bayes' rule, a prior and the power.
  3. Among significant results, only 5%5\% are false alarmsSuppose 90%90\% of tested changes do nothing, and the test has 80%80\% power for the rest. False alarms then make up 0.9⋅0.05=0.0450.9\cdot0.05 = 0.045 of all tests and true discoveries 0.1⋅0.8=0.080.1\cdot0.8 = 0.08, so Pr⁡(H0∣significant)=0.045/0.125=0.36\Pr(H_0 \mid \text{significant}) = 0.045/0.125 = 0.36: over a third of the significant results are false alarms.

2. Choosing the side after seeing the data

The data in Problem 2 point upward, so a one-sided test toward "up" looks natural.

  1. z=1.8z = 1.8, two-sided p≈0.072p \approx 0.072Right so far: Problem 2.
  2. “The mean went up, so test H1:μ>200H_1: \mu > 200.”The direction was chosen by the data. Had the mean gone down, the same analyst would have tested μ<200\mu < 200.
  3. p=0.036p = 0.036, significant at 5%5\%The rule "reject if z>1.645z > 1.645 or z<−1.645z < -1.645, whichever way the data went" is a two-sided test at level Pr⁡(∣Z∣>1.645)≈0.10\Pr(\lvert Z\rvert > 1.645) \approx 0.10, not 0.050.05. The honest p-value is 0.0720.072.

3. z instead of t with nine observations

The t statistic in Problem 4 has the same form as a z statistic, so the normal table seems to apply.

  1. t=(10.6−9.5)/(1.5/3)=2.2t = (10.6 - 9.5)/(1.5/3) = 2.2Right so far: Problem 4.
  2. “Compare with the normal: 2.2>1.962.2 > 1.96.”ss was estimated from the same nine runs, so the statistic varies more than a standard normal. The reference is tt with 88 degrees of freedom.
  3. p=2(1−Φ(2.2))≈0.028p = 2(1 - \Phi(2.2)) \approx 0.028, rejectThe right p-value is 2Pr⁡(T8>2.2)≈0.0592\Pr(T_8 > 2.2) \approx 0.059, and 2.22.2 falls short of the cutoff 2.3062.306. For large nn the two agree; at n=9n = 9 they give opposite conclusions.

4. One group's standard error used for the difference

Each conversion rate has a standard error, and the formula p^(1−p^)/n\sqrt{\hat p(1 - \hat p)/n} is the familiar one.

  1. p^=0.11\hat p = 0.11, n=2000n = 2000 per groupRight so far: Problem 5.
  2. “SE=0.11⋅0.89/2000≈0.0070\text{SE} = \sqrt{0.11\cdot0.89/2000} \approx 0.0070.”That is the standard error of one rate. The difference of two independent rates has variance equal to the sum of theirs, which adds the second 1/20001/2000.
  3. z=0.02/0.0070≈2.86z = 0.02/0.0070 \approx 2.86, p≈0.004p \approx 0.004The right standard error is 0.00702≈0.009890.0070\sqrt2 \approx 0.00989, giving z≈2.02z \approx 2.02 and p≈0.043p \approx 0.043. The mistake makes the result look ten times more significant than it is.

5. Testing twenty metrics and reporting the one that passed

Each metric was tested correctly at 5%5\%, so any one that comes out significant seems to be a real finding.

  1. Each test alone has a 5%5\% false-positive rateRight so far.
  2. “Report the metric with p=0.03p = 0.03 as a significant improvement.”The chance that some metric out of twenty passes by luck is not 5%5\%.
  3. The improvement is significant at the 5%5\% levelWith 2020 true nulls, 1−0.9520≈0.641 - 0.95^{20} \approx 0.64, and one false positive is expected (Problem 9). At the Bonferroni level 0.00250.0025, p=0.03p = 0.03 is nowhere near significant; or pick one primary metric before the experiment starts.

Print this set: hypothesis-tests-and-p-values.pdf (problems, answers, and worked solutions on separate pages).

Read the guide: Hypothesis tests and p-values: standardize under the null, choose the tails first, and never read p as the chance the null is true