Bell Statistics

What is a randomization unit?

The randomization unit is the thing assigned to a variant — a user, a session, a device or an account. It determines what counts as an independent observation, which every standard error in the analysis depends on.

Also called
unit of randomisation, assignment unit, experimental unit
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

Before an experiment can assign anything it has to decide what it is assigning. Users are the usual answer, but sessions, devices, accounts, pages and whole geographic markets are all used, and the choice is not a detail. It determines what an independent observation is, and every standard error, confidence interval and p-value in the analysis rests on that.

User-level is the default for good reasons. It gives a consistent experience — someone does not see one variant on Monday and another on Tuesday — and it keeps each person contributing one independent observation. Session-level assignment breaks both: a returning user can be assigned differently each visit, which is confusing to experience and means their sessions are neither independent of each other nor cleanly in one arm.

The choice is forced upward when users affect each other. Colleagues in a shared workspace will notice if half of them see a different interface, so cluster randomization by account is the answer. In a marketplace where both arms compete for the same supply, no user-level split is valid at all and the unit becomes time or geography — a switchback test or a geo experiment. The rule is that the unit must be large enough that assignment does not leak across its boundary.

Going coarser costs a great deal of power and it is worth knowing the shape of the cost. Randomising 400 accounts rather than 80,000 users means the effective sample size is closer to 400, not 80,000, because users within an account behave similarly. The relevant quantity is the intraclass correlation, and even modest within-cluster similarity inflates the required sample substantially. Cluster randomisation is chosen because it is necessary, not because it is better.

The most consequential thing about the choice is the constraint it places downstream. Whatever unit is randomised is the unit the analysis must respect: randomise users and the variance calculation is over users, even when the metric counts sessions or events. Getting this wrong is the single most common source of overconfident results in web experimentation, and it is the subject of the analysis unit.

The formula

One inflation factor governs what coarsening the unit costs, and it is why cluster designs need so much more data than their headline user counts suggest.

Effective sample size
n_eff = n / ( 1 + ( m − 1 ) · ICC )

m is the average cluster size, ICC the intraclass correlation. This is the design effect.

What that means in practice
m = 20, ICC = 0.1 → n_eff = n / 2.9

Even mild within-cluster similarity nearly triples the required sample — see the sample size calculator.

The downstream constraint
compute every variance across randomisation units

Randomise users, aggregate to users, then compare. Analysing at event level overstates precision.

When the unit must go coarser
if treating unit A can change unit B's outcome

Interference breaks the independence assumption, and no analysis at that unit repairs it.

Worked example

A B2B tool tests a new collaborative editing feature. Two designs are considered: randomise by user, which gives 24,000 units, or randomise by workspace, which gives 900 units averaging 27 users each. Colleagues share documents, so a user-level split would mean some people in a workspace see the feature and others do not.

User-level units
24,000
Workspace-level units
900 (mean 27 users)
Intraclass correlation, measured
0.14
Design effect
1 + 26 × 0.14 = 4.64
Effective sample, cluster design
24,000 / 4.64 ≈ 5,170
Detectable effect: user vs cluster
2.9% vs 6.3% relative

Cluster randomisation costs more than half the sensitivity — and the user-level design is not available, because contamination would invalidate it.

The arithmetic makes the cluster design look bad and the alternative is worse, which is the usual position. If half a workspace sees collaborative editing and half does not, the ones without it still encounter shared documents created with it, so control is contaminated and the measured effect is attenuated by an unknown amount. That is a biased estimate, whereas the cluster design gives an unbiased one with wider intervals — and a wide honest interval beats a narrow wrong one. What the numbers should change is the plan rather than the design: at 6.3% detectable, this test needs either a longer run or a more sensitive metric before it is worth starting. Note also the ICC of 0.14 is the number that drives everything here, and it was measured from historical data rather than assumed. Guessing it is how a cluster-randomised test ends up half the size it needed to be.

Common misconceptions

Randomising by session gives more data, so it is more powerful.
It gives more rows and not more independent information, since sessions from one person are correlated. It also means a returning user can be assigned to different arms on different visits, which makes their experience inconsistent and their data ambiguous. The apparent power gain is an artefact of counting correlated observations as independent.
You should always randomise at the finest unit available.
Only when treating one unit cannot affect another. Where users share documents, compete for supply, or simply talk to each other, a fine unit produces contamination that biases the result. The correct unit is the smallest one at which that leakage does not occur, which is often coarser than the data permits.
The randomization unit is an implementation detail for the platform team.
It determines what an independent observation is, which every standard error depends on, and it caps how much power the experiment can have. It is a design decision with statistical consequences that no amount of careful analysis afterwards can undo.

Frequently asked questions

How do I choose the randomization unit?
Start at user level and go coarser only when treating one user could affect another — shared workspaces, marketplaces, social features, or anything where people see each other's activity. The test is whether a control user could encounter the treatment through someone else. Going coarser costs real power, so it should be a response to a specific contamination route rather than a general precaution.
What is the intraclass correlation and how do I get it?
It measures how similar units within a cluster are compared with units across clusters, and it drives how much a cluster design costs. Estimate it from historical data by fitting a simple variance decomposition on the metric you plan to use — most statistical packages will do this directly. Values around 0.1 are common for workspaces and are enough to inflate the required sample severalfold.
Can the randomization unit change between experiments?
Between experiments yes, and it commonly should — a feature affecting only one person can be user-randomised while a collaborative one needs workspace-level. Within a single experiment it cannot change, since that would mean different users were assigned under different rules and the arms are no longer comparable. Changing it mid-flight requires restarting.

Related terms

  • Analysis unit

    The mismatch that makes confidence intervals two or three times too tight, with nothing in the output to show it.

  • Bucketing

    Three properties assignment must have — random, deterministic, independent — and what breaks when each one fails.

  • Cluster randomization

    Assign the group, not the person — the remedy for interference, paid for in statistical power.

  • Exposure point

    Assigned is not the same as exposed — and the gap between them is where most of your effect size goes.

Calculate it

  • A/B test sample size

    Size a two-proportion experiment before you launch, then read the lift and its interval once it lands.

  • Two-sample t-test

    Compare the average of two independent groups — plan the sample size, then test the result.

Knowing the term is the easy part

Applying it to a live measurement problem is the part that goes wrong. If you are designing an experiment, reading a result you do not trust, or trying to work out what your marketing actually caused, that is the work we do.

References

  • Kohavi, R., Tang, D., & Xu, Y. (2020). Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press.
  • Donner, A., & Klar, N. (2000). Design and Analysis of Cluster Randomization Trials in Health Research. Arnold.