Why randomization works
Watch chance balance the things you measured and the things you did not, and see what it can't protect you from.
What runs in CodeSplash
- A/B test analysis — SRM check, lifts, CUPED, guardrails and a Bayesian view Verified in Python and R
You will be able to
- Explain why randomization balances unmeasured variables on average
- Distinguish chance imbalance from a broken experiment
- Choose the unit of randomization to match how treatment spreads
Read first
The problem randomization solves
ReadIf you let users opt in to a new feature, keen users arrive first. Any difference you see mixes the feature with their keenness. That second cause is a confounderConfounderA variable that affects both the treatment and the outcome, creating a spurious association..
Assign the feature by coin flip and keenness can't be the reason someone got it. Across many users, keen and casual users land in both arms in similar shares. So do variables nobody thought to record.
This is why experiments support stronger claims than any adjustment: they balance what you never measured.
Flip the coins
ExploreDExplorable · What randomization balances
Does randomizing guarantee the groups match, and does it reach what you never measured?
In what share of assignments will the groups differ by more than 0.1 SD on the measured covariate?
Who gets treated
Commit your prediction above to see the result
Make your prediction to see the result.
Rerandomize several times. Watch one covariate's difference bounce around zero, sometimes large. Then raise the sample size and watch the bouncing shrink.
How big an imbalance would surprise you?
PredictPredict first
You compare 20 covariates between two properly randomized arms, each at the 5% level. How many would you expect to differ significantly?
Reveal
About one, by chance alone. A balance table with one "significant" row does not show broken randomization. That is why balance tests are a poor way to judge a randomized experiment.
Choose what gets randomized
ReadRandomize at the level where the treatment acts. If a change to a shared feed affects friends of treated users, randomizing individuals lets the effect leak into the control arm.
Common units are the user, the session, the cluster (a school, a city) and the time slot. Analyze at the unit you randomized, or your standard errors will be too small. See design effectDesign effectHow much the sampling design inflates a variance compared with a simple random sample of the same size. for how much clustering costs you.
Check your understanding
CheckpointCheck yourself
What can randomization balance that statistical adjustment can't?
Show the answer
Answer: b
Adjustment only reaches what you recorded. Randomization works on everything, measured or not, in expectation. It says nothing about what happens after assignment, such as people dropping out.
Check yourself
A pricing change is rolled out by store, and each store has many customers. What should your analysis respect?
Show the answer
Answer: b
Customers in one store share prices and much else, so they are not independent. Treating them as independent makes intervals too narrow.
Reflect
ReflectThink of a change you might test. Who could be affected other than the person who sees it? If the answer is "others too", write down what unit you would randomize instead.
Recap
Recap- Randomization balances measured and unmeasured variables on average.
- Chance imbalances still happen; one odd row in a balance table is expected.
- Randomize and analyze at the level where the treatment acts.
Concepts in this lesson