Lesson deck
Statistics and experimentation: intervals, tests, power, A/B tests and fair model comparison flashcards
Reviewing needs JavaScript. You can read every card in the list below.
Loading your cards...
Back to the lesson17 cards in this deck
Read all 17 cards as a list
- Front
- What is the standard error of a sample mean, and what does quadrupling n do?
- Back
- It is sigma / sqrt(n): the spread of the sample mean across repeated samples. Quadrupling the data halves the noise. The shape of the sampling distribution is Gaussian only for large n: with skewed data and n = 5, only 0.1% of means fell below the mean minus 1.96 SE and 4.4% fell above the mean plus 1.96 SE.
- Front
- What does a 95% confidence interval mean?
- Back
- The procedure that built it contains the true value in about 95% of repeated experiments. It is not a 95% probability that the parameter is in the one interval you computed, and it is not a range for single observations.
- Front
- Bias versus variance of an estimator: when does a biased one win?
- Back
- Mean squared error is bias squared plus variance. For a mean of 0.5 from 10 draws with sd 1, the sample mean had an error of 0.1003 and 0.8 times the mean had 0.0743: a bias of -0.1 bought a larger cut in variance. Dividing squared deviations by n averages 0.798 for a true variance of 1 at n = 5, so use n - 1.
- Front
- When do you use the bootstrap, and when does it fail you?
- Back
- When no formula exists for the statistic (median, AUC, ratio): resample with replacement, compute the statistic, read the percentiles. It does not rescue small or heavy-tailed samples: on lognormal data with n = 15 both the normal-approximation and the percentile intervals covered the true mean only about 80% of the time, and 96% of the misses were below the true mean.
- Front
- State what a p-value is and three things it is not.
- Back
- The probability, assuming no effect, of data at least as extreme as observed. It is not the probability that the null is true, not the size of the effect and not proof of importance. A large p-value from a small test is inconclusive, not evidence of no effect.
- Front
- Which test for which data?
- Back
- Two conversion rates: two-proportion z-test with the pooled error. Two means: t-test (Welch if variances differ). Counts against a design (SRM): chi-square goodness of fit, with observed and expected counts at least 5. Small or odd data, or any statistic: permutation test, exact when every split can be listed, otherwise (extreme + 1) / (B + 1).
- Front
- Type I error, type II error, power: define each.
- Back
- Type I: rejecting a true null, probability alpha. Type II: keeping a false null, probability beta. Power is 1 - beta, the chance of detecting a real effect of the assumed size. Under a true null the p-value is uniform: 2,000 A/A tests gave 4.1% below 0.05 and 49.5% below 0.5.
- Front
- How do you size an A/B test, and what does halving the lift cost?
- Back
- Fix the metric, baseline, minimum effect, alpha and power. For two proportions n = (z_alpha/2 + z_power)^2 (p1 q1 + p2 q2) / (p1 - p2)^2 per arm. At a 10% baseline: 3,839 for 12%, 14,749 for 11%, 57,760 for 10.5%. Halving the lift quadruples n. A shortcut is n = 16 sigma^2 / delta^2.
- Front
- Bonferroni versus Benjamini-Hochberg?
- Back
- Bonferroni tests each of m hypotheses at alpha / m and controls the chance of any false positive; it is strict. BH controls the expected share of false discoveries and rejects more. With p = 0.001, 0.012, 0.018, 0.030, 0.45 Bonferroni rejects 1 and BH rejects 4 at q = 0.05. With 20 true nulls the chance of at least one p < 0.05 is 0.642.
- Front
- Why is peeking a problem and what replaces it?
- Back
- Every look is another chance to cross the threshold. In 1,000 simulated A/A tests with up to 10 looks the false-positive rate was 0.058 at the planned end and 0.219 when stopping at the first significant look. Use a fixed horizon, or a sequential method built for continuous monitoring.
- Front
- What is a sample ratio mismatch and what do you do?
- Back
- The arm sizes differ from the design by more than chance allows: check with a chi-square test on the counts. 50,500 against 49,500 gives chi-square 10.0 (p = 0.0016); 520 against 480 gives 1.6 (p = 0.206). When it fires, find the assignment or logging bug first and do not read the treatment effect.
- Front
- What goes wrong if you randomise by user but analyse by page view?
- Back
- Views from one user are correlated, so the standard error is too small by a design effect 1 + (m - 1) rho. With m = 20 views and rho = 0.0909 it is 2.73, and 21.4% of A/A tests came out significant at 5%. Analyse at the level you randomised.
- Front
- The offline metric improved and the A/B test shows nothing. What do you check?
- Back
- In order: power for the expected lift, then metric mismatch (offline metric is not what users respond to), then selected or stale offline data, distribution shift, a training-serving bug and novelty. Keep guardrails in every test.
- Front
- Why can a correlation not prove that X causes Y?
- Back
- A confounder can drive both. With a hidden Z behind X and Y, the correlation was 0.502 although X had no effect; assigning X at random gave -0.008. Randomisation is the clean fix. Without it, designs such as matching or difference-in-differences need stated assumptions.
- Front
- Why compare two models with a paired test?
- Back
- They are scored on the same items, so errors overlap. On 1,000 constructed items with accuracies 0.770 and 0.798, McNemar on the disagreements (29 and 57) gave p = 0.0036 while the unpaired test gave p = 0.128. Report an interval for the gain. McNemar uses one training set, so it ignores training-set variability.
- Front
- Why is a plain t-test on cross-validation or repeated splits too optimistic?
- Back
- Training sets overlap, so scores are positively correlated and the variance is underestimated. The Nadeau-Bengio statistic uses (1/k + n_test / n_train) s^2 under the root. On ten constructed gaps from 90/10 splits it cut t from 8.95 to 6.16. Dietterich found the random-split t-test has a high type I error rate.
- Front
- Work the base-rate problem: 1% prevalence, 90% sensitivity, 10% false-positive rate.
- Back
- Use natural frequencies for 10,000 people: 100 sick, 90 test positive; 9,900 healthy, 990 test positive. P(sick | positive) = 90 / 1,080 = 0.0833. With 99% and 5% it is 0.1667; at 10% prevalence it is 0.5. Rare condition, mostly false alarms.