SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

Statistics for Analysts — Advanced

Production patterns, performance, security hardening

📄
Last updated Dec 2026
Expert Content

Statistics for Analysts — Advanced

Hypothesis Testing, in Plain Words

One-line idea: A hypothesis test assumes "nothing interesting is happening" (the null hypothesis), then checks whether your data is weird enough to doubt that.

Everyday comparison: It's like a courtroom's "innocent until proven guilty." You start by assuming the defendant is innocent (the null hypothesis), and only convict if the evidence is strong enough that "innocent" no longer makes sense. A statistical test works the same way: it assumes no real effect, then asks whether the data makes that assumption look implausible.

Common mistake + fix: Treating "we didn't find a significant effect" as proof that no effect exists. Fix: a test that fails to reject the null hypothesis just means "we didn't find strong enough evidence." It's not the same as "proven there's no effect," especially with a small sample.

Memory line: A hypothesis test doesn't prove your idea is right. It checks whether your data is surprising enough to doubt the boring default explanation.

P-Values: What They Are and Aren't

One-line idea: A p-value is the chance of seeing a result this extreme if the null hypothesis were true — not the chance your hypothesis is correct.

Everyday comparison: A low p-value is like a very unlikely coincidence. If you flip a coin 10 times and get 10 heads, that's a p-value-style red flag — "if this coin were fair, this result would be really unlikely." That flag makes you suspect the coin isn't fair, but it doesn't prove the coin is rigged; it just makes the "fair coin" explanation hard to believe.

💡 In simple words

One-line idea: "p = 0.03" means a result this rare happens 3% of the time under the null — not a 3% chance the null is true.

Try it in 2 minutes: A report says "p = 0.001, so there's only a 0.1% chance our result is due to chance." Is that the correct interpretation of a p-value?

Answer: No. The correct reading: "if there were truly no effect, a result this extreme would happen only 0.1% of the time." It describes how surprising the data is under the null hypothesis — not the probability that the null hypothesis itself is true.

Common mistake + fix: Treating p < 0.05 as "proven" and p > 0.05 as "definitely nothing here." Fix: 0.05 is a conventional threshold, not a law of nature — report the actual p-value and the effect size. Treat anything near the threshold (0.04 or 0.06) as genuinely borderline, not a hard pass/fail.

Memory line: A small p-value makes "nothing's going on" hard to believe. It is not a probability that your hypothesis is true.

A/B Testing, End to End

One-line idea: An A/B test splits users into two groups, shows each a different version, and checks whether the difference is bigger than random noise.

Everyday comparison: It's like testing two different shop-window displays on two similar streets for a month, then comparing foot traffic. If one display clearly outperforms, you've got a real signal; if they're close, the difference might just be random day-to-day variation.

Worked example: A website tests page-load time (seconds) for two button designs. Variant A (old button): 3.2, 3.5, 3.1, 3.6, 3.3, 3.4, 3.0, 3.5. Variant B (new button): 2.9, 3.1, 2.8, 3.0, 2.7, 3.2, 2.9, 3.0.

Running a two-sample t-test (Welch's, which doesn't assume the two groups have equal variance — the safer default for two independently collected samples):

•t-statistic: 3.99
•Degrees of freedom: 13.03
•Two-tailed p-value: 0.0015

A p-value this small (well under the conventional 0.05 threshold) is informative. If there were truly no difference between the two button designs, a gap this large between the samples would happen only about 0.15% of the time by chance. That's strong evidence Variant B's load time is genuinely faster, not just a lucky sample.

python
from scipy import stats
a = [3.2, 3.5, 3.1, 3.6, 3.3, 3.4, 3.0, 3.5]
b = [2.9, 3.1, 2.8, 3.0, 2.7, 3.2, 2.9, 3.0]
t_stat, p_value = stats.ttest_ind(a, b, equal_var=False)   # Welch's t-test
print(t_stat, p_value)   # 3.988620176087328, 0.0015379924124003796 (df reported separately)

Sample Size, Intuitively

One-line idea: A tiny sample can only detect a huge effect. A small real difference needs a much bigger sample to stand out from noise.

Everyday comparison: Flipping a coin 4 times and getting 3 heads tells you almost nothing about whether the coin is biased. Flipping it 4,000 times and getting 3,000 heads is a completely different story — same 75% rate, wildly different strength of evidence, purely because of sample size.

Common mistake + fix: Running an A/B test for 3 days with 40 total users and concluding "no significant difference, the designs are equal." Fix: before running the test, estimate how many users you'd need to detect a difference worth caring about — a sample-size calculator using your baseline rate and target effect size. "No significant difference" with too few users often just means "not enough data to tell," not "truly equal."

The Peeking Problem

One-line idea: Checking a test's p-value daily and stopping once it dips below 0.05 inflates your real false-positive rate well above 5%.

Everyday comparison: It's like flipping a coin 100 times but stopping and declaring "it's rigged!" the very first moment you happen to be ahead. If you check constantly and stop at the first lucky-looking moment, you'll "detect" a rigged coin far more often than 5% of the time, even on a perfectly fair one.

Common mistake + fix: Peeking at results daily and stopping as soon as p < 0.05 appears, even briefly. Fix: decide the sample size (or test duration) in advance, and only check significance once that point is reached. Or use a sequential-testing method designed for safe early stopping, rather than ad hoc peeking.

Practical vs. Statistical Significance

One-line idea: A result can be statistically significant but still too small to matter for the business — different questions entirely.

Everyday comparison: Detecting that Variant B's load time is "significantly" 0.1 seconds faster, with a huge sample, might be statistically real but practically meaningless if nobody notices a 0.1-second difference. Statistical significance answers "is this real?" — practical significance answers "is this worth doing anything about?"

Common mistake + fix: Reporting only the p-value and treating "significant" as automatically "important." Fix: always report the actual effect size (how big the difference is, in real units) alongside the p-value, and let a business decision-maker judge whether that size matters.

Memory line: Statistically significant means "probably real." Practically significant means "big enough to act on." A result needs both before it changes a decision.

Related: [A/B Testing a Subject Line](/academies/marketing/content-social-email/advanced) — the exact same sample-size and peeking-problem cautions above, applied to testing two email subject lines against each other.

Simpson's Paradox

One-line idea: A trend in every subgroup can reverse once you combine them — so aggregated numbers can lie even when every group's data is correct.

Everyday comparison: A hospital's surgery team might have a better success rate than a rival team on both easy and hard cases separately. Yet it can still show a worse overall rate, if it simply treats far more hard cases than the rival does. Looking only at the combined number would wrongly suggest the team is worse, when it's actually better at both levels measured.

Worked example: Two support agents resolve tickets, split into simple and complex tickets:

Agent A: ticketsAgent A: avg timeAgent B: ticketsAgent B: avg time

|---|---|---|---|---|

Simple1010 min4012 min
Complex4050 min1055 min
Combined50 42.0 min50 20.6 min

Agent A resolves tickets faster on both ticket types individually (10 vs. 12 min on simple, 50 vs. 55 min on complex). Yet Agent A's combined average (42.0 min) is worse than Agent B's (20.6 min).

The reversal happens because Agent A mostly handles slow complex tickets (40 of 50), while Agent B mostly handles fast simple ones (40 of 50). The combined number is a weighted average. And the weights — how many of each ticket type — differ sharply between the two agents.

Excel/Sheets:  =SUMPRODUCT(B2:B3,C2:C3)/SUM(B2:B3)
python
import numpy as np
counts = np.array([10, 40])      # Agent A: simple tickets, complex tickets
averages = np.array([10, 50])    # Agent A: avg time per group
combined = np.sum(counts * averages) / np.sum(counts)
print(combined)   # 42.0

Common mistake + fix: Comparing two groups only on an aggregated total number. Fix: whenever a comparison involves subgroups that might differ in size or mix (different case difficulty, regions, time periods), check the trend within each subgroup. Do this before trusting the combined number.

Memory line: The combined number can say the opposite of what every individual group says. Always check the subgroups before trusting the total.

Common Analyst Traps

•Cherry-picking the date range that makes a chart look best, instead of a fixed, pre-decided window.
•Confusing correlation with causation (see the Intermediate page) — especially with two trends that both happen to be rising over time.
•Treating a non-random sample as representative — a survey of only your most engaged users doesn't describe your average user.
•Stopping an A/B test the moment it looks significant (the peeking problem above) instead of waiting for the pre-committed sample size.
•Reporting the mean on skewed data (salary, deal size) without checking whether the median tells a more honest story (see the Fundamentals page).

Memory line: Most analyst mistakes aren't bad math — they're an honest-looking shortcut taken before the data was actually ready to answer the question.

Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
→
✅Quick Check — Statistics for Analysts
1 / 1

What is the first step when optimizing a production system?

Up Next
🗺️
Statistics for Analysts — Roadmap
Step-by-step structured learning path from zero to expert
Also Worth Exploring
← Back to all Statistics for Analysts modules
← IntermediateRoadmap →