Bell Statistics

What is the analysis unit?

The analysis unit is the level at which observations are counted when computing a result. When it is finer than the randomization unit — sessions analysed from a user-randomised test — correlated rows are treated as independent and every interval comes out too narrow.

Also called
unit of analysis, observation unit, aggregation level
Allon Korem

Written by Allon Korem

Chief Executive Officer

Last updated

In plain English

An experiment randomises something and then analyses something. When those are the same thing, the standard machinery works. When the analysis unit is finer — users randomised, sessions or events analysed — the observations are no longer independent, and every standard error computed from them is too small. This mismatch is probably the most common source of overconfident results in web experimentation, and it is invisible in the output.

The mechanism is straightforward once seen. A user with twenty sessions contributes twenty rows, and those twenty rows are highly correlated: a heavy user is heavy in all of them. Treating them as twenty independent observations claims twenty times the information the experiment collected from that person. Across the dataset, apparent sample size inflates by roughly the average number of rows per user, and the interval shrinks by roughly the square root of that — a factor of two or three in ordinary web analytics.

The fix is to aggregate to the randomization unit before comparing. Compute each user's total or average, then run the comparison over users. A metric like clicks per session becomes a ratio metric under this treatment, whose variance needs the delta method or a bootstrap rather than the naive formula — which is a real complication and the honest one. The alternative shortcuts, such as a mixed-effects model with a random intercept per user, are valid but heavier than most experimentation platforms want to run on every metric.

There is a subtler version worth watching for, where the analysis unit is coarser than the randomization unit. Randomise users and analyse at the account level by averaging users within an account, and you have thrown away information and created units of unequal reliability — an account with three users and one with three hundred count the same. That direction is less common and less damaging, but it wastes power rather than inventing it.

The practical diagnostic is an A/A test run many times. If the observed spread of effects across hundreds of null comparisons is larger than the standard error the platform reports, the analysis unit is too fine. That check catches the problem for every metric at once, and it is the reason A/A validation belongs in any new platform's launch checklist.

The formula

One inflation factor, and the aggregation that removes it. The size of the error is set by how many rows each randomised unit contributes.

The inflation
apparent n = n_users × rows per user

52,000 users with 4 sessions each looks like 208,000 observations and contains 52,000 units of information.

How wrong the interval is
SE_naive ≈ SE_correct / √( rows per user )

Four sessions per user gives an interval half as wide as it should be.

The fix
aggregate to the randomisation unit, then compare

Per-user totals or averages, then an ordinary two-sample comparison — see the two-sample t-test calculator.

The detector
observed SD across many A/A runs vs reported SE

If observed spread exceeds the reported standard error, the analysis unit is too fine.

Worked example

A publisher tests a recommendation module on articles read. The experiment randomises 46,000 users, who generate 318,000 sessions. The result is computed two ways: over sessions, as the analytics tool defaults to, and over users after aggregating.

Users randomised
46,000
Sessions
318,000 (6.9 per user)
Effect, session-level
+2.4%, SE 0.51%, p < 0.001
Effect, user-level
+2.4%, SE 1.34%, p = 0.073
Ratio of standard errors
2.63
√(sessions per user)
2.63

Identical point estimates, and standard errors differing by exactly the square root of sessions per user. One is significant and the other is not.

The last two rows are the diagnosis rather than a coincidence — the ratio of the two standard errors matches √6.9 almost exactly, which is the signature of treating correlated rows as independent. The point estimate is unaffected, and that is what makes this error so persistent: the headline number looks the same either way, so nobody notices that only the uncertainty changed. The correct reading of this experiment is that a 2.4% lift was observed and three weeks was not enough to establish it, with an interval running from roughly −0.2% to +5.0%. The session-level version would have shipped it as a confident win. The general rule this illustrates: whenever the number of analysed rows exceeds the number of randomised units, the standard error is wrong unless something has been done about it, and the factor is predictable enough to estimate before looking.

Common misconceptions

More rows in the analysis means more statistical power.
Only if the rows are independent. Sessions from one user carry largely the same information, so additional rows from the same person add very little. Power comes from the number of randomised units, and analysing at a finer level inflates apparent precision without adding any real evidence.
The point estimate is right, so the analysis is basically fine.
The point estimate is usually unaffected and the uncertainty around it is wrong, often by a factor of two or three. That is enough to turn an inconclusive result into a confident one, which is precisely the decision the experiment existed to inform. A correct estimate with a wrong interval is not a usable result.
This only matters for session-based metrics.
It applies to any analysis unit finer than the randomisation unit — page views, events, orders, impressions. Anywhere one randomised user can contribute several rows, the same inflation occurs. The question to ask of any metric is how many rows a single assigned unit can produce.

Frequently asked questions

How do I fix an analysis unit mismatch?
Aggregate to the randomisation unit before comparing: compute each user's total or average, then run the two-sample comparison over users. For metrics that are genuinely ratios of two sums, use the delta method or a cluster bootstrap that resamples whole users. A mixed-effects model with a per-user random intercept is also valid and is usually heavier than an experimentation platform wants on every metric.
How can I tell if my platform has this problem?
Run several hundred simulated A/A tests on historical data and compare the observed spread of effects against the standard errors the platform reports. If the observed spread is larger, the analysis unit is too fine for at least that metric. The ratio between them is usually close to the square root of rows per user, which both confirms the diagnosis and tells you how far off the intervals are.
What if the analysis unit is coarser than the randomization unit?
That direction wastes power rather than inventing it, so it is the safer error. Averaging users up to accounts when users were randomised discards information and produces units of very unequal reliability, since a three-user account counts the same as a three-hundred-user one. Weighting by size helps, but analysing at the level you randomised is simpler and correct.

Related terms

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

  • Randomization unit

    What gets assigned decides what counts as independent — and that decides whether your p-values mean anything.

  • Ratio metric

    When the denominator is random too, the ordinary standard error is wrong — and the interval it produces is too narrow.

Calculate it

  • Proportion confidence interval

    A defensible interval around one rate — Wilson, Agresti-Coull, Jeffreys and Clopper-Pearson, side by side.

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