Module 18 of 52 · Modelling and statistics

Inference and experiments

30 min 3 outcomes Interactive + drag challenge 5 sources cited

By the end of this module you will be able to:

  • Design a valid A/B test with proper controls
  • Explain p-values and their limitations
  • Describe common experimental pitfalls

Inference scope bounded on population, time, treatment, outcome

A finding holds only inside the four bounds the study set, population, time, treatment and outcome, and a claim that leaves any one of them unstated has quietly been stretched past the study that produced it.

Every inference is bounded on four axes: population (who the sample represents), time (when the data was gathered), treatment (what was actually tested), outcome (what was measured). Stretching any axis beyond the study is extrapolation. The ASA 2016 statement makes this explicit; bounded claims survive replication, unbounded claims do not.

Inference scope bounded on population, time, treatment, outcome A fenced enclosure and the way out of it. A light grey container bordered in red and marked with a red left bar is labelled Inside the study. In a row inside it sit four white cards of equal size: Population, who the sample represents; Time, when data was gathered; Treatment, what was actually tested; Outcome, what was measured. Each carries a source tag, ASA 2016 on three and CS229 on Treatment. No arrow joins them, because none comes before another. Four red arrows of equal weight drop from the cards, cross the bottom wall and point into a filled red band naming extrapolation as the unmarked exit. A knockout label between the middle pair reads extrapolation. A finding is fenced by four bounds, and it holds only inside all four Inside the study 1PopulationWho the samplerepresentsASA 2016 2TimeWhen data wasgatheredASA 2016 3TreatmentWhat was actuallytestedCS229 4OutcomeWhat was measuredASA 2016 extrapolation Extrapolation is the unmarked exitA finding from 18-25 year olds in 2019 does not generalise to over-65s in 2025 under a different treatment dose. State all fourbounds in every claim.

Four-link evidence chain that makes a claim defensible

A result is only as defensible as the chain beneath it: the question fixes what was asked, the sample and method fix how, the statistic carries its uncertainty, the claim boundary limits it, and a result missing any link is opinion.

Every analytical claim travels with a four-link evidence chain: question, sample + method, statistic + uncertainty, claim boundary. Break any link and the claim becomes opinion. The ASA 2016 statement on statistical significance and W3C PROV-DM both expect this chain to be auditable.

Analytical claims travel with a four-link evidence chain Two aligned rows of four. The upper row is the chain, left to right: Question (what is being asked), Sample + method (population, design, statistics), Statistic + uncertainty (point estimate + interval), which is emphasised in red, and Claim boundary (what it does and does not support). Red arrows join them, labelled above the row: tested via, summarised by, bounded by. Under each link, tied to it by a dashed line, a pale card names what the claim loses if that link is dropped: the result floats, results cannot be reproduced, point estimates mislead, extrapolation invents findings. A filled red band closes the figure with the claim that breaking any link turns the claim into opinion. Four links, and what the claim loses when one of them breaks 1QuestionWhat is being askedASA 2016 2Sample + methodPopulation, design,statisticsASA 2016 3Statistic +uncertaintyPoint estimate + intervalASA 2016 4Claim boundaryWhat it does and doesnot supportW3C PROV-DM tested via summarised by bounded by Without the question, the result floats. Without the method, results cannot be reproduced. Without uncertainty, point estimates mislead. Without boundary, extrapolation invents findings. Break any link and the claim becomes opinionThe ASA 2016 statement and W3C PROV-DM both expect this chain to be auditable.

Evidence strength ladder from anecdote to meta-analysis

Strength climbs from anecdote through observation and controlled comparison to randomised trial and replicated meta-analysis, and while an anecdote can establish that a case exists, only the upper rungs support a claim about a population.

Evidence strength climbs five rungs: anecdote, observation, controlled comparison, randomised experiment, replicated meta-analysis. The GRADE framework (Guyatt et al. 2008) is the canonical reference; each rung supports a narrower claim than the one above it.

Evidence-strength ladder from anecdote to meta-analysis Five cards climb from the lower left to the upper right, each standing 22 units higher than the last, so the four red arrows joining them rise. The arrows carry no label: the climb is the geometry. Left to right: Anecdote (one case, no design, GRADE very low), Observation (pattern in collected data, GRADE low), Controlled comparison (cohort or matched design, GRADE low), Randomised trial (causal claim defensible, GRADE high), emphasised in red, and Meta-analysis (replicated across studies, GRADE high, the top of the scale). A dashed floor runs under the ladder, with a stem from each rung down to it that lengthens as the rungs climb. The Cochrane Handbook is tagged at the top right. Five rungs, and each one stands higher than the rung below itCochrane Handbook GRADE: very lowAnecdoteOne case, nodesign GRADE: lowObservationPattern in collecteddata GRADE: lowControlledcomparisonCohort or matcheddesign GRADE: highRandomised trialCausal claimdefensible GRADE: highMeta-analysisReplicated acrossstudies The strength-claim mismatch is the failure modeAn anecdote supports an existence claim, not a population claim. Treating observation as causation claims more than theevidence can carry.

Four design choices and what each one protects

Randomisation is what defends a causal claim, by removing confounding; blocking and replication make the estimate precise and blinding keeps expectation out of the measurement, so each one dropped costs something different.

Experiment design is four choices: randomisation, blocking, replication, blinding. Randomisation balances measured and unmeasured confounders in expectation and defends the causal claim; blocking and replication make the estimate precise, and blinding keeps expectation out of the measurement. Fisher (1935) named the first three; CONSORT 2025 (item 20) asks trials to report who was blinded and how.

Four design choices and what each one protects Two registers in four columns and a closing band. Along the top sit four white cards at one depth, with no arrow between them: Randomisation, closes selection bias; Blocking, controls known nuisance; Replication, estimates random noise; Blinding, closes expectation bias. Three are tagged Fisher 1935, the fourth CONSORT 2025. A dashed tie drops from each to a fainter card naming the risk without it: without randomisation, selection bias; without blocking, a noisier estimate and a wider interval; without replication, no error bars; without blinding, expectation drives outcome. A filled red band closes: randomisation defends the causal claim, and the others protect precision and measurement. Four choices made in one design, and what each one protects 1RandomisationCloses selection biasFisher 1935 2BlockingControls known nuisanceFisher 1935 3ReplicationEstimates random noiseFisher 1935 4BlindingCloses expectation biasCONSORT 2025 Without randomisation selection bias Without blocking a noisier estimate and a wider interval Without replication no error bars Without blinding expectation drives outcome Randomisation defends the causal claimBlocking and replication make the estimate precise, and blinding keeps expectation out of the measurement.

Reading a p-value without making the common four mistakes

A p-value states the probability of a result at least this extreme if the null hypothesis and the model hold, not the truth of the hypothesis or the size of the effect, so reading it as a verdict at a bright line ships findings that fail on replication.

A p-value is the probability, if the null hypothesis and the model's assumptions hold, of a result at least as extreme as the one observed. It is not the probability the hypothesis is true; it is not the size of the effect; it is not a binary verdict. The ASA 2016 statement on statistical significance names six principles and warns against bright-line thresholds.

Reading a p-value without making the common four mistakes One statement with three qualifications hanging from it. Centred at the top sits the only emphasised card, filled pale red with a red border: What it is, the probability of a result at least this extreme under the null hypothesis and the model, tagged ASA 2016, What is a p-value. From its lower edge three light dashed ties fan out and drop to three white cards of equal size, at one depth and joined by nothing: What it is not, truth of hypothesis or effect size; Effect and interval, always quote alongside; Full reporting, disclose every test run. The ties carry no arrowheads. A filled red band closes the figure with the bright-line 0.05 defect and what to report instead. What a p-value is, and three qualifications it cannot be read without 1What it isP(at least this extreme | H0, model)ASA 2016, What is a p-value? 2What it is notTruth of hypothesis or effect sizeASA 2016 principle 2 3Effect + intervalAlways quote alongsideASA 2016 principle 5 4Full reportingDisclose every test runASA 2016 principle 4 The bright-line 0.05 is the named defectp < 0.05 is not a verdict; treating it as one ships findings that fail replication. Report effect size and confidence interval alongside.

Obama's campaign showed why test design beats executive preference.

During the 2012 US presidential campaign, digital teams tested email subject lines, donation prompts, and landing pages rather than relying on senior preference. The widely reported lesson was not that one phrase always wins. It was that small changes can have material effects only when the comparison is randomised and measured.

The previous module, Probability and distributions, covered how to interpret statistical patterns. This module covers how to create decision-grade evidence deliberately through experiments, and why a short read can introduce the discipline but cannot replace a full statistics or experimentation programme.

The winning subject line was 'Hey.' It outperformed polished alternatives by 49%. Would you have predicted that?

Experimentation is how we move from correlation to causation. An A/B test (randomised controlled trial in a business context) isolates the effect of a single variable by comparing a treatment group to a control group. Everything else is held constant. The difference in outcomes can be attributed to the variable you changed. The formal mathematics appears later; here the priority is the design discipline that keeps decisions honest.

A credible experiment starts before any data is collected.

17.1 Designing a valid A/B test

An A/B test is a randomised comparison between a control and a treatment. It is powerful because randomisation makes the groups comparable before the change is applied. Five requirements make the result decision-grade:

  1. Random assignment: participants are randomly assigned to treatment or control. Non-random assignment introduces selection bias.
  2. Single variable: only one thing differs between groups. Changing the headline AND the button colour simultaneously means you cannot attribute the effect to either one.
  3. Adequate sample size: small samples produce noisy results. A power calculation before the test determines the minimum sample needed to detect an effect that is large enough to matter.
  4. Pre-specified hypothesis: decide what you are measuring and what counts as success before running the test. Changing the metric after seeing results is p-hacking.
  5. Sufficient duration: run the test long enough to capture natural variation (weekday vs weekend, payday effects, seasonal patterns). Stopping early because one variant looks good is a common error.

“Proper inference requires full reporting and transparency.”

American Statistical Association (2016) - ASA Statement on Statistical Significance and P-Values, Principle 4

A test plan, primary metric, sample-size calculation, exclusions, and stopping rule need to be visible before analysis. Without those controls, a positive result may be a reporting artefact rather than evidence.

A design that satisfies those requirements still has to be sized before anyone can run it.

17.2 Sample size, duration and the stopping rule

Worked example: if checkout conversion is 3.2% and the smallest useful improvement is a 15% relative lift, the target is 3.68%. A test with too few visitors may miss that improvement or overreact to noise. The leadership implication is direct: launch decisions should be tied to minimum detectable effect, sample size, and guardrail metrics before the experiment starts.

Common misconception

“We ran the test for two days and variant B is winning. Let us launch it.”

Two days is rarely long enough to capture natural variation. Weekend vs weekday behaviour, payday effects, and seasonal patterns can all produce misleading short-term results. A power calculation before the test determines the minimum duration. Stopping early based on interim results inflates the false positive rate.

Loading interactive component...

The result is only useful if the uncertainty is interpreted correctly.

17.3 Understanding p-values

A p-value answers a narrow question: if there were no real difference between groups, how unusual would this result be under the statistical model? A p-value of 0.03 means the observed result, or a more extreme one, would occur about 3% of the time if the null hypothesis and model assumptions were true.

The conventional threshold is p < 0.05, but this is arbitrary, not sacred. A p-value of 0.049 is not meaningfully different from 0.051. The American Statistical Association published a statement in 2016 warning against the binary interpretation of p-values and the practice of p-hacking (running many tests and reporting only the significant ones).

Report the effect size and confidence interval alongside the p-value. A statistically clear result can still be commercially irrelevant if the effect is tiny. A commercially large effect can still be uncertain if the interval is wide. The executive question is not "is it significant?" It is "is the effect large enough, reliable enough, and safe enough to act on?"

“Scientific conclusions and business or policy decisions should not be based only on whether a p-value passes a specific threshold.”

American Statistical Association (2016) - ASA Statement on Statistical Significance and P-Values, Principle 3

The ASA statement was unprecedented: a professional body publicly correcting widespread misuse of its own methodology. It emphasised that p-values do not measure the probability that the hypothesis is true, and that context, study design, and effect size all matter alongside p-values.

Common misconception

“A p-value of 0.01 means there is a 1% chance the result is wrong.”

A p-value of 0.01 means: if there were no real effect, there is a 1% chance of observing a result at least this extreme. It does not tell you the probability that the effect is real. That requires Bayesian analysis, which incorporates prior knowledge. The distinction matters: a p-value of 0.01 from a poorly designed experiment with a tiny sample is much less convincing than a p-value of 0.04 from a well-powered, pre-registered study.

17.4 Check your understanding

A product team runs an A/B test on two homepage designs. After three days, Design B has a 12% higher click-through rate than Design A. The team has 4,000 visitors in each group. The product manager wants to launch Design B immediately. What is the problem?

A study reports a p-value of 0.04. The researcher says this means there is a 96% probability that the treatment works. What is the error?

A marketing team tests five different email subject lines simultaneously. One achieves p = 0.03. They declare it the winner. What experimental pitfall is this?

Loading interactive component...

Experiment checks to carry forward

  • A valid A/B test requires random assignment, one intended change, a useful primary metric, an adequate sample size, and a stopping rule set before launch.
  • P-values describe data compatibility with a null model. They do not measure the probability that a hypothesis is true or that a decision is safe.
  • Effect size, confidence interval, guardrail metrics, and study design matter alongside the p-value. Binary threshold thinking is not enough for business or policy decisions.
  • Multiple variants increase the chance of a false positive. Adjust the analysis plan or treat the result as exploratory until confirmed.

Standards and sources cited in this module

  1. American Statistical Association (2016), 'ASA Statement on Statistical Significance and P-Values'

    Full statement

    Corrects widespread p-value misinterpretation. Principle 3 cited directly in Section 17.3.

  2. Kohavi, R., Tang, D., and Xu, Y. (2020). Trustworthy Online Controlled Experiments

    Chapters 1-5

    Modern reference for A/B testing at scale. Covers power analysis, early stopping, guardrails, and multiple comparisons.

  3. Optimizely, 'Obama's $60 Million Experiment' (2013)

    Case study

    Secondary report behind the campaign testing example. Used as an illustration, not as a universal rule about subject-line wording.

  4. CRISP-DM 1.0

    Evaluation and deployment phases

    Reinforces that analytics work must be evaluated against business objectives before deployment.

  5. DAMA-DMBOK2 Revised (2024) (print edition; the link is DAMA's publisher page, not the chapter text)

    Data Science and Analytics knowledge area

    Framework for experimental analytics within data management practice.

Build it in the workspace

The artefact this module describes, as something you can fill in.

Module 18 of 52 · Modelling and statistics