Skip to content

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.

Introductory ~9 min7 steps

What runs in CodeSplash

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

01

The problem randomization solves

Read

If 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.

02

Flip the coins

Explore

DExplorable · 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?

0.50
How sure?
100

Who gets treated

Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

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.

03

How big an imbalance would surprise you?

Predict

Predict first

You compare 20 covariates between two properly randomized arms, each at the 5% level. How many would you expect to differ significantly?

None of themAbout one of themAbout five of them
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.

04

Choose what gets randomized

Read

Randomize 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.

05

Check your understanding

Checkpoint

Check 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.

06

Reflect

Reflect

Think 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.

07

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