InteractiveBreakoutsPredict, observe, explainRecall with feedbackDecisionAccessibility not checkedPublished
Checking balance, then searching for it: you are the genetic algorithm
By Alexis Diamond · Statistics · causal inference · Graduate · Computational / statistical · version 9
Licence: CC BY 4.0
Assumption ledger (11)
- dataPart 1 samples are 200 evenly spaced quantiles of each distribution (no random noise), so the pictures show the shapes cleanly.
- distributionPart 1 uses a two-sample Welch t-test. Part 2 uses a paired t-test on matched pairs, as GenMatch does after matching.
- distributionKS p-values come from a bootstrap of the pooled sample (500 draws, the same draws every time), as in Matching::ks.boot. The bootstrap is what makes KS and t agree for binary variables; the textbook asymptotic KS formula does not.
- interpretation"Exactly the same in large samples" is answered yes only for the binary variable: there both tests compare the share of 1s, so their p-values converge. For the other four cases the tests answer different questions, even when both p-values happen to be high or both low.
- dataPart 2 data are simulated (seed 4): 120 treated and 800 controls, built to resemble the LaLonde data. The true effect of treatment is $1,500.
- simplificationDistance = √Σ (wₖ · Δxₖ / sₖ)², with sₖ the pooled standard deviation of covariate k: a diagonal weight matrix without GenMatch's covariance (Cholesky) adjustment. One-to-one nearest neighbour with replacement; ties go to the first control.
- parameterEach weight is 0, ¼, 1, 4 or 16 (3,124 possible settings once all-zero is excluded). Only the ratios matter, which the normalized shares show.
- simplificationThe ATT is the mean of treated-minus-matched-control outcomes; its p-value and interval come from a paired t-test, not the Abadie–Imbens standard error the Matching package reports.
- dataPart 3 data are simulated (seed 5): 100 tutored and 900 untutored students with prior GPA, family income, commute time and first-generation status. Distances use the same standardized, weighted formula as Part 2.
- simplificationPart 3 is a genetic algorithm with a population of 3 and at most 5 generations; the best candidate so far is carried into the next generation (elitism), and students do the mutation and crossover themselves. The best of all 624 weight settings (0.741) was found offline by checking every one with this same code.
- parameterThe full-search summary (best smallest p 0.571; averages of estimates by balance level) was computed offline by running every one of the 3,124 settings through this same code.
Checks Breakout ✓ · Accessibility ✓
Breakout check
✓ Ready for breakouts: every control we tried showed teammates the same thing.
Cite this · History
Cite this
Alexis Diamond (2026). Checking balance, then searching for it: you are the genetic algorithm [Interactive model], version 9. Ideas at Play. https://ideasatplay.org/play/checking-balance-then-searching-for-it-you-are-the-genetic-a-69216d?v=9 (CC BY 4.0)
History
- v9Results: 'Run the search again (clears generations 1–5)' replaces 'Start Part 3 over'; the last step says 'End of the activity' instead of a greyed-out Next. (edited, Nov 4, 2026)current
- v8Generations: Mutate and Cross over buttons for slots 2–3 (seeded, shared), 'Back to the best' replaces the copy button, history shows one row per generation. Results: the guarantee covers only the smallest p; an example shows a well-balanced variable losing balance as the score rises. (edited, Nov 4, 2026)View
- v7Part 1 predictions are now Low (below 0.05) or High (0.05 or more); 'medium' removed. Every case's p-value is clearly on one side. (edited, Nov 4, 2026)View
- v6Removed the CS130 code box: live sessions now have a Freeze all rooms button for the host. (edited, Nov 2, 2026)View
- v5One step per screen: ten steps in one step bar (five cases, the balance question, search, outcome, generations, results), each with its question above its controls. Copy trimmed. (edited, Nov 2, 2026)View
- v4New Part 3: a tutoring case run as a formal genetic search by hand (3 candidates per generation, 5 generations, best so far carried forward automatically). (edited, Nov 2, 2026)View
- v3Part 1: bigger shift case, now case C; married case shows one pair of bars; each case asks whether the two p-values are the same in large samples; new question on high vs low balance p-values; button to Part 2 at the bottom. (edited, Nov 2, 2026)View
- v2Instructor freeze (code CS130, lower left). Normalized weights note when rounded shares do not add to exactly 1. (edited, Nov 2, 2026)View
- v1Imported; lineage before import is not available. (imported, Nov 2, 2026)View
Comments
No comments yet.
Sign in to comment or like.