TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Experimental Unit: Definition and Why It Matters in A/B Tests

The experimental unit is what gets randomly assigned. How it differs from the observational unit, and a worked example showing how randomizing by user but analyzing by session turns p = 0.11 into p = 0.03.

Xu An Reviewed by Lucas Hayes Also called experimental units Last updated Nov 28, 2026 Glossary

Quick answer

An experimental unit is the entity independently and randomly assigned to a treatment or control group, such as a user, account or region. It sets the sample size. Analyzing repeated measurements of one unit, such as sessions of a user-split test, as independent understates the standard error.

Formula: Design effect = 1 + (m − 1) × ρ; effective sample size = observations ÷ design effect; corrected SE = naive SE × √design effect (m = measurements per unit, ρ = intracluster correlation).

What is an experimental unit?

An experimental unit is the entity that is independently and randomly assigned to a treatment or control group. In a website A/B test that splits traffic by user, the experimental unit is the user; in a pricing test that assigns whole companies, it is the account; in a field trial that treats whole plots, it is the plot. The UK's National Centre for the Replacement, Refinement and Reduction of Animals in Research (NC3Rs) defines it in its DRIVER recommendations as the entity independently assigned to different experimental groups, and stresses that the sample size of an experiment is the number of experimental units.

The observational unit (or unit of analysis) is what you measure. Often it is the same thing, but in digital analytics it frequently is not: you randomize users and then count sessions, pageviews or clicks. That mismatch is the point of this page. When the analysis treats repeated measurements of one experimental unit as independent, the standard error is understated and results look more significant than they are. NC3Rs calls this pseudoreplication and notes that it does not increase the sample size of an experiment; it underestimates variability and raises the risk of false positives. The worked example below shows by how much.

Experimental unit vs observational unit vs sampling unit

TermWhat it isWebsite exampleWhat goes wrong if confused
Experimental unitWhat is randomly assigned to a groupThe user (cookie or login ID) in a user-split testSample size counted in the wrong unit
Observational unitWhat is measuredEach session, pageview or orderCorrelated rows treated as independent
Sampling unitWhat is drawn from the populationVisitors who reached the test page in the test windowResults generalized beyond who was sampled
ClusterA group of units assigned togetherAll users of one company accountUsers in one account are not independent

The terms come from experimental design in agriculture and medicine, but the mapping to web data is direct. A session is a measurement of a user's visit; a user can have many sessions, and their behavior across those sessions is correlated (a user who is about to buy visits several times).

How do you identify the experimental unit?

Ask one question: what did the coin flip decide? Whatever the randomization assigned as a whole is the experimental unit.

  • Split by user ID or cookie: the user. Every session, pageview and event of that user is an observation of one unit.
  • Split by session (each new visit gets a fresh coin flip): the session. The same person may see both versions, which contaminates the comparison for anything that builds up over visits.
  • Split by account or company: the account. Ten users in one company are one unit for the treatment, not ten.
  • Split by region or store: the region or store. A geo test with 20 regions has a sample size of 20, however many visitors those regions contain.
  • Split by pageview (each page load randomly assigned): the pageview. Rarely appropriate for anything a user notices twice.

Then check the metric: its denominator should be the experimental unit, or a ratio whose variance is computed at the experimental unit's level. Conversion per user fits a user split. Conversion per session in a user split needs the correction below.

Worked example: randomized by user, analyzed by session

Sample data: 1,000 users are split 500 / 500 by user ID. Each user has 3 sessions on average, so each group has 1,500 sessions. The metric chosen is session conversion rate.

AnalysisControlVariantzTwo-tailed p
Per session, rows treated as independent90 / 1,500 = 6.0%120 / 1,500 = 8.0%2.1470.032
Per session, corrected for clustering (design effect 1.8)samesame1.6000.110
Per user: converted at least once75 / 500 = 15.0%95 / 500 = 19.0%1.6840.092

How the first row is computed: pooled rate (90 + 120) ÷ 3,000 = 7.0%; standard error √(0.07 × 0.93 × (1/1,500 + 1/1,500)) = 0.00932; z = 0.020 ÷ 0.00932 = 2.147, p = 0.032. That looks significant at 0.05.

But the 3,000 sessions come from only 1,000 users. Assume, as sample data, that sessions of the same user are correlated with an intracluster correlation (ICC) of 0.4: a user who converted in one session is more likely to convert in another. The design effect is 1 + (3 − 1) × 0.4 = 1.8, so the true standard error is √1.8 = 1.34 times larger than the naive one. Dividing z by 1.34 gives 1.600 and p = 0.110. The 3,000 rows carry the information of about 3,000 ÷ 1.8 ≈ 1,667 independent sessions, not 3,000.

The per-user analysis, which matches the experimental unit directly, gives z = 1.684 and p = 0.092. Both honest analyses agree: the test has not shown a difference at the 5% level. The naive per-session analysis turned a non-result into a "win".

The design effect formula

For clusters of equal size m and intracluster correlation ρ:

Design effect = 1 + (m − 1) × ρ

Effective sample size = number of observations ÷ design effect

Corrected standard error = naive standard error × √design effect

Killip, Mahfoud and Pearce (Annals of Family Medicine, 2004) show the same effect in a clinical study: 4 practices with 32 patients each and ρ = 0.017 give a design effect of 1.527, so 128 enrolled patients were worth about 84, and the study's power dropped to 61%. Even a small correlation matters when clusters are large. On websites, users with 10 or 20 sessions in a test window are common, so a per-pageview or per-session analysis can overstate significance severely.

When cluster sizes vary and the metric is a ratio (conversions per session, revenue per pageview), the delta method gives the right variance without assuming one ρ. Deng, Knoblich and Lu describe it for large-scale A/B testing metrics whose aggregation level differs from the randomization unit (KDD 2018).

How to fix a unit mismatch

  1. Analyze at the experimental unit. Collapse to one row per user: converted or not, revenue per user, sessions per user. Then standard two-sample tests apply. This is the simplest fix and the one to try first.
  2. If the metric must be per session or per pageview, correct the variance. Use the delta method, cluster-robust standard errors or a bootstrap that resamples users, not sessions.
  3. Randomize at the level you want to analyze, if the treatment allows it. A change that only affects one page view can be randomized per pageview, as long as nobody sees both versions in a way that matters.
  4. Count N in experimental units in the report and in the power calculation. A statistical power calculation that uses sessions as N overstates power for a user-split test.
  5. For accounts and regions, plan for few units. Twenty accounts per group is twenty units; expect wide intervals and plan the test length accordingly.

The broader test workflow these steps fit into is in the A/B testing guide.

Common mistakes with experimental units

  • Reporting "3,000 sessions" as the sample size of a test that assigned 1,000 users.
  • Switching the unit mid-analysis, for example randomizing by cookie and then joining logged-in users across devices, so one person ends up in both groups.
  • Using a session-split test for a multi-visit behavior such as subscription, where the same user sees both versions across visits.
  • Ignoring account-level clustering in B2B, where colleagues share a decision and a budget.
  • Removing "outlier" users after looking at results, which changes the units after randomization and breaks the comparison.

Keeping units straight in TapCub

TapCub does not assign variants or run experiments; it measures what happened. What helps here is that its reports state their unit, so you can line the analysis up with the unit your testing tool randomized.

  1. Read the unit off each report. Web analytics › Overview reports visitors, sessions and pageviews as separate numbers, so you can see how many sessions each visitor contributed in the test window (here, 3,000 ÷ 1,000 = 3).
  2. Use a per-person denominator for conversion. In Web analytics › Goals, the conversion rate's denominator is distinct visitors in the range, not sessions, and each goal shows distinct people who converted. That matches a user-level split directly. TapCub's documentation notes that the data report's rate divides by sessions instead, so do not mix the two in one test readout.
  3. Choose the identity to match the randomization. In All-platform analytics › Behavior › Behavior analysis, uniques follow the identity you pick: visitor, device, person (logged-in ID, else device, else visitor) or account. If your tool randomized logged-in users, use person; if it randomized companies, use account.
  4. Export per-unit rows for the test. All-platform analytics › Data › Data export produces raw rows asynchronously; collapse them to one row per user in your statistics tool and run the test there.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Xu An

Customer Experience Consultant

Writes about live chat, visitor conversations, and self-service, sharing practical ways to make customer communication clearer and more effective.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is an example of an experimental unit?

In a website test that assigns each user to version A or B, the user is the experimental unit; their sessions and pageviews are observations of that unit. In a pricing test that assigns whole companies, the company account is the unit, so 20 companies per group means a sample size of 20.

What is the difference between an experimental unit and an observational unit?

The experimental unit is what the randomization assigns; the observational unit is what you measure. They are often the same, but a user-split test measured per session has one experimental unit (the user) and several observational units (sessions), which are correlated and must not be counted as independent.

How do you identify the experimental unit?

Ask what the random assignment decided as a whole. If a coin flip put a user in a group, the user is the unit; if it put a company, store or region in a group, that is the unit. The sample size and the variance of your test statistic should be counted in that unit.

What is pseudoreplication?

Pseudoreplication is treating multiple measurements of the same experimental unit as if they were independent units. It does not add information, but it shrinks the standard error. In this page's example it turns a per-session p-value of 0.110 into 0.032 when 3,000 sessions from 1,000 users are treated as independent.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics