
Foundations of statistical significance
Null and alternative hypotheses, sampling distribution, test statistic, and p-value. From Ronald Fisher's tea lesson (1925) to numerical A/A testing, including limitations of frequentist testing and operational validation templates.
What you will learn
- Understand the analytical problem and the decision-making context
- Apply examples, metrics, and controls to real cases
Foundations of statistical significance
Un esperimento mostra una differenza tra la variante A e la variante B, e il team deve capire se sta osservando un segnale affidabile o una variazione compatibile con il caso. I fondamenti della significatività statistica introducono il linguaggio minimo per ragionare su rumore, ipotesi nulla, errore e decisione. La categoria è Decisione, quindi il punto non è accumulare definizioni ma capire quale scelta cambia quando il dato diventa più affidabile. La significatività non decide da sola: aiuta a separare rumore, evidenza e impatto pratico, e per questo va trattata come uno strumento per migliorare una decisione concreta, con assunzioni esplicite e controlli minimi.
Il problema reale
Decidere con esperimenti robusti significa non abusare di p-value, peeking o letture casuali del rumore. Il problema non è conoscere la teoria in astratto, ma capire cosa fare quando i dati sono incompleti, le metriche ambigue o i vincoli tecnici rendono fragile la lettura. Una lezione utile deve separare il segnale dal rumore, indicare quale baseline usare e mostrare quale azione diventa più difendibile dopo l’analisi. Se alla fine non sai indicare quale decisione cambia, quale dato osservi e quale errore vuoi evitare, la lezione non è ancora diventata competenza applicata.
Il modello concettuale
Il modello è volutamente semplice: decisione, dato, controllo, azione. Ogni approfondimento tecnico deve rafforzare almeno uno di questi quattro punti, altrimenti rischia di trasformare una nozione in un rituale vuoto.
| Phase | What to clarify | Output |
|---|---|---|
| Question | Which real choice needs improvement? | Decision to make |
| Measure | Which observable signal represents the problem? | Metric or source data |
| Control | Which baseline makes the result interpretable? | Credible comparison |
| Action | What changes after the analysis? | Next operational step |
La formalizzazione
Per rendere il tema analizzabile conviene definire prima l’unità di lavoro (unità sperimentale, metrica, variante, campione o effetto), poi collegarla a una metrica osservabile (MDE, potenza, intervallo, errore, varianza e rischio business) e infine dichiarare la decisione attesa (disegno esperimento, calcolo potenza, analisi o decision memo). La formalizzazione è solida quando un altro analista può riprodurre la logica, criticare le assunzioni e ottenere la stessa decisione partendo dagli stessi dati.
| Element | Requested specification |
|---|---|
| Unit of analysis | experimental unit, metric, variant, sample, or effect |
| Primary signal | MDE, power, interval, error, variance, and business risk |
| Baseline | Previous period, comparable group, benchmark, or counterfactual scenario |
| Decision | experiment design, power calculation, analysis, or decision memo |
| Risk | Mistaking an available number for sufficient proof |
The origins: Ronald Fisher and the “ladies tasting tea” (1925)
In 1925 Ronald Fisher published Statistical Methods for Research Workers, the book that crystallized the modern approach to hypothesis testing. But perhaps an earlier anecdote, the “ladies tasting tea,” better illustrates the core of his thinking.
Una signora sosteneva di saper distinguere, assaggiando una tazza di tè con latte, se il latte era stato versato prima o dopo il tè. Fisher progetta un esperimento: prepara otto tazze, quattro con latte prima e quattro con latte dopo, e le presenta in ordine casuale alla signora, chiedendole di classificare ciascuna. Non si tratta di un test di sapori qualsiasi: Fisher vuole dimostrare che esiste un modo logical e quantitative way to determine whether the result is due to a real ability or chance.
How do you set up the problem?
Fisher defines a null hypothesis (H₀): the lady has no discriminating ability; every correct answer is due to chance. Then, under this hypothesis, he calculates the probability of obtaining each possible outcome. If the lady guesses all eight cups correctly, the probability is:
P(\text{8/8 corrette} \mid H_0) = \frac{1}{\binom{8}{4}} = \frac{1}{70} \approx 0{,}014
Fisher sceglie di rifiutare H₀ se la probabilità dei dati osservati sotto l’ipotesi nulla è inferiore a 1 su 70, una soglia che oggi chiamiamo significance level (α). With 8/8 correct, the lady passes the test with strong evidence.
This experiment is important not for the tea, but for the logical mechanism it introduces: a skeptical default hypothesis, a measure of evidence against it, a decision threshold. That mechanism is today the core of frequentist testing.
Historical note: Fisher did not use the term “p-value” exactly as we understand it today. For him, the calculated value was an index of evidence, not a rigid decision switch. The formalization into the rule “if p < α, reject H₀” came later with Jerzy Neyman and Egon Pearson, who introduced the dichotomy between Type I and Type II errors.
Null hypothesis and alternative hypothesis
Every hypothesis test starts from two competing statements.
Null hypothesis (H₀): it is the status quothe statement that there is no effect, difference, or relationship. It is the hypothesis the test tries to falsify. Examples:
- La media del gruppo trattamento è uguale alla media del gruppo controllo:
- La conversione non cambia:
- Il coefficiente di regressione è zero:
Alternative hypothesis (H₁ or Ha): it is what we want to prove, the presence of an effect. Examples:
- (bilaterale)
- (unilaterale, direzionale)
The choice between one-sided and two-sided tests is not trivial. If you have a clear directional expectation (the new design should increase conversion), you can use a one-sided test, which has more statistical power. But if there is even a possibility that the effect goes in the opposite direction (and worsens the metric), you must use a two-sided test. Most production A/B tests use two-sided tests for caution.
The operational rule is simple: H₀ is the hypothesis you want to reject; H₁ is the hypothesis you want to support. The test does not “prove” H₁, but evaluates whether the data are sufficiently incompatible with H₀ to justify its rejection.
The sampling distribution
The most difficult and important concept of statistical significance is the sampling distribution.
If you could repeat the same experiment infinitely many times, each time you would calculate a different statistic (e.g., the difference in means). The distribution of all these statistics, across samples, is the sampling distribution.
Here is the key property: under H₀, we know the shape of this distribution. Per una media campionaria, il Teorema del Limite Centrale ci dice che la distribuzione campionaria è approssimativamente normale con media pari alla media della popolazione e deviazione standard pari all’errore standard (\sigma / \sqrt{n}).
For a difference between two proportions (as in an A/B test), under H₀ the sampling distribution of the difference is normal with mean 0 and standard deviation given by:
SE = \sqrt{p(1-p)\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}
where è la proporzione pooled sotto H₀.
La distribuzione campionaria conta perché è il ponte tra ciò che osserviamo, cioè un singolo numero come la differenza nel nostro esperimento, e ciò che ci aspettiamo sotto H₀. Se la differenza osservata cade nelle code estreme della distribuzione, dove la probabilità è bassa, allora abbiamo evidenza contro H₀.
The five-step hypothesis test
Here is the operational sequence you will use in every significance test.
| Step | Action | Example (A/B test) |
|---|---|---|
| 1 | Define H₀ and H₁ | H₀: ; H₁: |
| 2 | Choose α (significance level) | α = 0.05 (Type I error acceptable at 5%) |
| 3 | Calculate test statistic | z = \frac{\hat{p}_T - \hat{p}_C}{SE} |
| 4 | Calculate p-value | Probability of observing a z at least this extreme under H₀ |
| 5 | Compare p-value with α | If p < α, reject H₀; otherwise, do not reject H₀ |
I passi 3 e 4 sono tecnici, ma il ragionamento resta sempre lo stesso: You measure the distance between your data and the null hypothesis, and ask “how rare is this deviation if H₀ were true?”.
Concrete example: numerical A/A test
An A/A test is an experiment where both groups receive exactly the same treatment. There is no real difference: H₀ is true by design.
Perché fare un test A/A? Per calibrare il sistema. Se il tuo test di significatività funziona correttamente, in un test A/A dovresti osservare un risultato “significativo” (p < α) esattamente in una proporzione α dei casi. Con α = 0,05, circa 1 test A/A su 20 mostrerà un falso positivo per puro caso.
Let's simulate numerically.
Simulation setup
Immagina un prodotto con una conversione base del 10%. Assegniamo 10.000 utenti a ciascuno di due gruppi identici (A e A). Entrambi vedono la stessa esperienza. Calcoliamo la differenza nelle conversioni e il p-value, e ripetiamo l’esperimento 1.000 volte.
| Iteration | Conv. Group A | Conv. Group A’ | Difference | p-value | Significant? |
|---|---|---|---|---|---|
| 1 | 10,12% | 9,88% | +0,24% | 0,57 | No |
| 2 | 9,95% | 10,05% | -0,10% | 0,81 | No |
| 3 | 10,45% | 9,55% | +0,90% | 0,04 | Yes (false positive) |
| 4 | 10,01% | 9,99% | +0,02% | 0,96 | No |
| 5 | 9,80% | 10,20% | -0,40% | 0,35 | No |
| … | … | … | … | … | … |
| 1.000 | 10,03% | 9,97% | +0,06% | 0,89 | No |
Result: su 1.000 test A/A, 52 hanno dato p < 0,05, una proporzione del 5,2%, coerente con α = 0,05.
This simulation teaches three things.
- The system works: the false positive rate is close to the nominal level α.
- False positives are inevitable: anche con un test perfettamente calibrato, circa 1 esperimento su 20 produrrà un risultato “significativo” per puro caso.
- Interpretation is contextual: se vedi p = 0,04 in un test A/B reale, non puoi sapere se è un vero effetto o uno dei circa 5% di falsi positivi attesi. Per questo servono repliche, potenza adeguata e validazione esterna.
What to do if the A/A test yields too many false positives
If your system produces significance much more often than α in A/A tests (e.g., 15% instead of 5%), there is a structural problem. Possible causes:
- Defective randomization system: the division between groups is not balanced on confounding variables.
- Non-independent metric: the primary metric has autocorrelation or depends on shared events (e.g., a user in both groups due to tracking error).
- Peeking: you look at the result before the sample is complete and decide to stop when you see a low p. This inflates the Type I error rate dramatically (up to 20-30%).
- Post-hoc segmentation: you look for significance in subgroups (by device, by country) until you find something “significant.”
A regular A/A test is the best calibration you can do. If you don’t do A/A tests, you don’t know if your measurement system is reliable.
Limits of frequentist testing
The statistical significance framework is powerful but has three structural limits every analyst must know.
Limit 1: The p-value does not tell how likely H₁ is
The p-value answers: “If H₀ were true, what is the probability of observing data at least this extreme?”
It does not answer: “What is the probability that H₁ is true?” o “What is the probability that H₀ is false?”
Questa confusione è pervasiva. In un sondaggio del 2019 condotto su 1.500 ricercatori (Nature, 2019), il 58% interpretava erroneamente p < 0,05 come “c’è meno del 5% di probabilità che i risultati siano dovuti al caso”, che è la definizione sbagliata. Il p-value è condizionato a H₀, non a H₁.
Limit 2: Dependence on sample size
Con campioni enormi, qualsiasi effetto, anche irrilevante, diventa statisticamente significativo. Con campioni piccoli, anche effetti importanti possono non raggiungere la significatività.
Example: with 10 million users, a 0.01% conversion difference will almost certainly produce p < 0.001. The effect is real, but is the rollout worth it? Probably not, if the implementation cost exceeds the benefit.
Al contrario, un aumento del 15% della conversione su un campione di 200 utenti per gruppo potrebbe dare p = 0,12, non significativo per α = 0,05, ma potenzialmente interessante se estendi il test.
Frequentist testing does not automatically incorporate practical relevance. That’s why every test should be accompanied by effect size and confidence interval.
Limit 3: The multiple comparisons problem
Every hypothesis test has a probability α of giving a false positive. If you run K independent tests, the probability of at least one a false positive rises to:
P(\text{almeno 1 falso positivo}) = 1 - (1 - \alpha)^K
With α = 0.05 and K = 20 tests, the probability of seeing at least one “fake” significant result is about 64%. With K = 100, it approaches 99.4%.
In the real world, this manifests in three ways.
- Simultaneous multiple tests: you analyze 10 metrics and find a “winner.” Is it really an effect or a false positive?
- Post-hoc segmentation: suddividi per dispositivo, browser, paese, e a un certo punto trovi un segmento significativo.
- Sequential peekingYou look at the result every day and decide to stop when you see p < 0.05. This is equivalent to running dozens of tests on the same data.
There are corrections (Bonferroni, Holm, Benjamini-Hochberg) but they don’t solve the root problem: statistical significance is a measure of evidence, not a certificate of truth.
Template check for test validity
Before declaring a result “significant,” verify these seven points. If even one fails, the test is not reliable.
| # | Question | What to check | Outcome |
|---|---|---|---|
| 1 | Valid randomization? | Is the division between groups random and balanced on known variables (device, traffic source)? | ✅ / ❌ |
| 2 | Independence of observations? | Is each unit assigned to only one group? Is there no spillover between groups? | ✅ / ❌ |
| 3 | α defined ex-ante? | Was the significance level chosen before looking at the data? | ✅ / ❌ |
| 4 | Sample size determined ex-ante? | Was the sample size (or duration) fixed before the experiment? | ✅ / ❌ |
| 5 | Motivated two-tailed or one-tailed test? | Is the choice justified by the business question, not by the result? | ✅ / ❌ |
| 6 | Effect size reported? | Does the result include the effect size and its confidence interval? | ✅ / ❌ |
| 7 | Stable guardrails? | Have secondary metrics (revenue, bounce rate, errors) not significantly worsened? | ✅ / ❌ |
If you answer ❌ to one or more points, the test is invalid or the conclusions need to be reviewed.
Threshold interpretation
Significance at p < 0.05 is the most common standard, but it is not universal. Here is how to choose α based on the decision context.
| Context | Recommended α | Ratio |
|---|---|---|
| Exploration / idea generation | 0,10 | Low false positive cost, better to explore |
| Standard A/B test (UX, marketing) | 0,05 | Accepted standard; balances false positives and false negatives |
| Critical product launch (checkout, payments) | 0,01 | Very high false positive cost (revenue loss, churn) |
| Clinical / regulatory test | 0.001 or less | People's lives depend on the decision |
Warning: lowering α reduces false positives but increases false negatives (failing to detect a real effect). The choice of α is a trade-off, not an absolute truth.
Lab e checkpoint
Al livello base, scrivi una scheda di una pagina: decisione da supportare, metrica primaria, baseline, rischio principale e azione se il segnale è confermato. Al livello intermedio, costruisci una tabella con tre segmenti, periodi o scenari e per ciascuno indica cosa cambia, quale spiegazione alternativa è plausibile e quale controllo useresti prima di raccomandare un’azione. Al livello research-grade, prepara un decision memo con ipotesi, dati richiesti, criteri di esclusione, controlli di qualità, soglia decisionale, rischio residuo e piano di monitoraggio. Per i dati puoi usare A/B test, A/A test, log esperimenti, metriche prodotto, simulatori e dataset sintetici; se non hai accesso a dati reali, crea un dataset sintetico con almeno 200 righe, una dimensione temporale, una dimensione segmento e una metrica di outcome.
L’errore più comune è usare i fondamenti come etichetta invece che come processo: un grafico senza decisione, una metrica senza baseline, una conclusione senza dire quale assunzione potrebbe invalidarla. La domanda di controllo è netta: se questo risultato fosse instabile, quale scelta sbaglierei? Se la risposta non è concreta, manca ancora il collegamento tra analisi e azione. Per verificarti, prova a rispondere: quale decisione concreta dovrebbe migliorare questa lezione, quale unità di analisi rende il problema misurabile, quale baseline eviterebbe una lettura ingenua, quale errore tipico cambierebbe la conclusione e quale output consegneresti a uno stakeholder non tecnico.
Summary
In this lesson you have seen the foundations of statistical significance.
- Null and Alternative Hypotheses: H₀ is the default skepticism; H₁ is what you want to prove. The test does not “prove” H₁ but evaluates whether the data are incompatible with H₀.
- Sampling Distribution: the distribution of the test statistic under H₀, which allows calculating how “extreme” the observed result is.
- Hypothesis Testing in Five Steps: formulate H₀ and H₁, choose α, calculate the test statistic, calculate the p-value, compare with α.
- Historical Case: Fisher’s tea experiment (1925) introduces the logical mechanism we still use today.
- Numerical A/A Test: simulazione di 1.000 test A/A che mostra il 5,2% di falsi positivi, esattamente quanto previsto da α = 0,05.
- Limits of frequentist testing: the p-value is not the probability of H₁, it depends on the sample, and suffers from the multiple comparisons problem.
- Template Check: seven questions to validate the quality of every test before drawing conclusions.
Una domanda che gli studenti pongono spesso è: «se la significatività statistica ha tutti questi limiti, perché la usiamo ancora?» La risposta è che non esiste un’alternativa altrettanto pratica per il lavoro quotidiano. Il Bayesianesimo offre un framework più intuitivo (le probabilità sono direttamente interpretabili come credenze), ma richiede la specificazione di prior che in contesti aziendali sono difficili da difendere. L’approccio frequentista, con tutti i suoi difetti, fornisce un linguaggio comune e riproducibile, che due team diversi possono applicare allo stesso test ottenendo la stessa conclusione. È un communication standard oltre che uno strumento statistico. La prossima lezione applica queste fondamenta alla formulazione di domande causali e ipotesi business ben strutturate.
Related Path
Lessons to read together
Questi collegamenti portano la lezione dentro il resto del corso: basi da riprendere, passaggi successivi e connessioni tematiche tra moduli.