Mohamed A. Adel.

Statistics for Data Analysis

Topic 4 of 14 · In Data Analysis · September 8, 2026

⏱ 1–2 WeeksBeginner

The statistics analysts actually use: averages that don't lie, spread, distributions, correlation, and thinking about chance.

++++FREE LEARNING PATHDATA ANALYSISDATA ANALYSIS · PHASE 2 · INTERMEDIATESTATISTICS FOR DATAANALYSISThe statistics analysts actually use: averages that…· 2 / 3BEGINNER1–2 WEEKSmotif / bellμ-1.25σ+1.25σ9634 · 34 · MODULE 3.4

Overview

Statistics sounds intimidating, but a Data Analyst uses a surprisingly small, practical slice of it. Statistics is really the science of making sense of numbers when there is variability — and almost all real data varies.

The payoff of this topic is huge: you will stop reporting a single average as if it told the whole story, you will know whether a difference you see in a report is real or just luck, and you will finally understand why "correlation is not causation" is the most repeated warning in the field. Everything here stays at the level a working analyst needs — no proofs, no calculus.

Before You Start

  • Complete the Basics topic and have your spreadsheet or notebook ready with the delivery dataset you will reuse (orders with delivery minutes and a partner flag).
  • Be able to compute mean, median and standard deviation in your tool of choice before starting.
  • Re-read the outlier discussion from the Data Cleaning topic so detect-investigate-decide is fresh in your mind.
  • Have the Excel correlation function (or pandas correlation in Python) ready for the correlation exercise.
  • Bring the vocabulary from Basics: you should be able to name a measure and a dimension without looking them up.

Learning Objectives

  • Use mean, median and mode — and know when each one misleads
  • Measure spread with range, variance and standard deviation
  • Read percentiles, quartiles and the interquartile range (IQR)
  • Understand what a distribution is, including the normal distribution and skew
  • Explain sampling and sampling bias, and why sample ≠ population
  • Detect and decide what to do about outliers
  • Interpret correlation correctly and distinguish it from causation
  • Grasp hypothesis testing: null/alternative, p-value, significance
  • Tell statistical significance from practical significance
  • Apply these ideas to a real dataset and make defensible claims

Prerequisites

Basics (data types, metrics, data quality) and comfortable arithmetic. No math background needed — you will compute everything in Excel or Python anyway.

Why Statistics Matters

Every dataset is a sample — a subset — of a bigger reality (a population). One month of orders is a sample of all months; 200 surveyed users are a sample of all users. Statistics answers two questions analysts ask constantly: "What is the truth, roughly?" (descriptive stats) and "Is this difference real or just luck?" (inference). Without this lens, a report that compares two averages can confidently state a false conclusion — because the difference was noise.

Measures of Center: Mean, Median, Mode

Mean = sum ÷ count (the average). Median = the middle value when sorted. Mode = the most frequent value.

The trick is skew: a few huge values (a mansion in house-price data) pull the mean up while the median stays undisturbed. Example: five salaries — 100, 110, 120, 130, 1,000. Mean = 292 (misleading), median = 120 (honest). Analysts report median for income, house prices, session lengths — anything with outliers. Click AVERAGE in Excel for a clean symmetric spread; click MEDIAN when big values can yank the story sideways.

Measures of Spread: Range, Variance, Standard Deviation

Center tells you where the middle is; spread tells you how squashed or scattered the values are.

  • Range = max − min (fragile — one outlier blows it up)
  • Variance = average squared distance from the mean
  • Standard deviation (SD) = sqrt(variance) — spread in the data's own units

Low SD = values huddle near the mean (consistent delivery times); high SD = values swing widely (unpredictable). For a normal distribution about 68% of values sit within ±1 SD and 95% within ±2 SD. Comparing two groups with the same average but very different SDs tells you which is stable and which is wild.

Percentiles, Quartiles and the IQR

Percentiles mark the sorted data cut-offs: the 25th percentile (Q1), the 50th (median, Q2) and the 75th (Q3) split the data into quarters. The Interquartile Range (IQR) = Q3 − Q1 = the middle 50% band.

IQR is the professional's outlier detector: values below Q1 − 1.5×IQR or above Q3 + 1.5×IQR are classic outliers. Two practical uses: report "the middle 50% of orders were $25–$60" (a far truer picture than an average), and flag suspicious records before analysis.

Distributions: The Shape of Your Data

A distribution is just a histogram of where the values fall. The famous normal distribution (bell curve) shows up when many small factors add up: heights, measurement errors, long-run averages. Its shape lets you estimate how common extreme values are.

Real business data is often skewed instead: revenue, order amounts and salaries pile up near the low end with a long right tail (right-skewed) — the same reason medians beat means. Recognizing skew immediately tells you which summary and which chart will be honest, and whether a log/normalized transform might improve your analysis.

Sampling and Sampling Bias

Analyzing a whole population is often expensive or impossible, so analysts work on samples. A sample is only useful if it fairly represents the population — that is the crux of sampling bias.

Classic bias traps: surveying only app users for a product used on desktop and mobile; judging satisfaction only from complaints (angry people self-select); A/B tests that include only power users. Whenever you hear "based on N surveys", ask how were these people chosen? A biased sample produces confident garbage no matter how clean the analysis is.

Correlation (and Why It Is Not Causation)

Correlation (r, from -1 to +1) measures whether two variables move together. Ice-cream sales and drowning accidents correlate strongly in summer — one does not cause the other; a third force (warm weather) drives both.

Correlation ≠ causation because a relationship could be coincidence, due to a lurking variable, or even reversed. To prove cause you need experiments (A/B tests, controlled trials) or very strong domain logic. A good analyst reports associations honestly and labels causal claims only when the evidence truly supports them.

Outliers

Outliers are extreme values that sit far outside the pack. They are not automatically errors — a whale account ordering 1,000 units is real, valuable data.

Analyst protocol: detect → investigate → decide. Detect with IQR or z-scores; investigate whether it's an error, a data-entry bug, or a genuine event; then decide — flag it, exclude it (documenting why), cap it, or keep it split for a separate analysis. Never silently delete; never let one absurd row pull your whole average.

Hypothesis Testing: Significance in One Page

When a report says a change is statistically significant, it means the observed difference is unlikely to be pure chance.

  • Null hypothesis (H₀): nothing is happening — the new button converts the same as the old (difference = 0)
  • Alternative hypothesis (H₁): a real effect exists
  • Test statistic + p-value: a p-value is the probability of seeing results at least this extreme if H₀ were true. p < 0.05 is the common "unlikely to be luck" line

Two caveats that matter daily: a small p-value doesn't mean a large effect (statistical ≠ practical significance), and a large dataset will flag even trivial differences as significant. Analysts always report the size of the effect, not just its p-value. Confidence intervals show the range the true value likely sits in — "conversion lifted 0.4% (±0.3%)" — and are the more honest cousin of a single point estimate.

Hands-On Practice

Use a real dataset (house prices, salaries, deliveries — anything with outliers).

  1. Compute mean, median, mode and SD; decide which to report and why.
  2. Find quartiles and IQR; flag every IQR-based outlier and classify each as error vs genuine.
  3. Draw the histogram; describe skew and what it means for the average.
  4. Pick two numeric columns; compute correlation in Excel (=CORREL); write two plausible non-causal explanations.
  5. Split your data into two groups (e.g. regions); compare means + SDs and judge if the difference looks real or within noise.

Deeper Worked Examples

These examples push further than the core content — each one is a complete, step-by-step solution you can follow and then reproduce on your own.

Is the new delivery partner actually faster?

Problem. The last-mile team claims a new partner cut delivery times. You have 60 deliveries per partner with delivery_minutes recorded. Old partner: mean 42, median 39, standard deviation 12, with three values above 90. New partner: mean 38, median 35, standard deviation 15, with one value at 210 — a stranded van. The data are right-skewed.
1

Step 1

State the metric and the question: is the difference in delivery minutes real or noise, and is the review distorted by the 210-minute outlier?
2

Step 2

Compare centres properly for skewed data: report the medians, 39 versus 35 minutes, and say the new partner is about 4 minutes faster on a typical order rather than trusting the 4-point mean gap blindly.
3

Step 3

Compare spread honestly: the old partner shows a standard deviation of 12 against the new partner's 15, so the new service is faster on average but less consistent — state that trade-off explicitly.
4

Step 4

Run detect-investigate-decide on the 210-minute value: confirm it is a genuine stranded van, keep it in the dataset, flag it, and recompute the medians with the value removed so the typical picture is visible.
5

Step 5

Estimate the size and the uncertainty: the median gap is about 4 minutes with a rough confidence interval of plus or minus 3 minutes, so the effect is small but plausibly real — 'much faster' would be over-claiming.
6

Step 6

Write the four-line verdict for the team: median delivery time fell from 39 to 35 minutes, spread widened, the outlier is genuine and flagged, and the honest headline is 'modestly faster but slightly less predictable'.

When an 8% lift might be noise

Problem. The web team changed the checkout button and reports conversion rising from 4.2% to 4.5%. Before spending budget on the change, check whether the difference is likely real, using 10,000 sessions per version.
1

Step 1

Translate the business claim into statistics: the null hypothesis is that the new button converts at the same rate, the alternative is that it converts differently, and the observed gap is 0.3 percentage points.
2

Step 2

Note what the sample can support: with 10,000 sessions per version each 4% rate has a small standard error, so compute the rough confidence interval for the 0.3-point gap.
3

Step 3

Decide the honest readout: if the interval for the lift runs from roughly zero to 0.7 points, the direction is encouraging but the true effect could still be zero — label it 'suggestive, not proven'.
4

Step 4

Separate statistical from practical significance: a 0.3-point lift on 1.5 million annual visits is around 4,500 extra conversions, which may justify keeping the button even though the effect is not dramatic.
5

Step 5

Report the size of the effect rather than just a p-value, and add the guardrail metric: confirm revenue per session did not fall while conversion rose.
6

Step 6

Present the recommendation: run the test slightly longer, or accept the change with the documented effect size and the unchanged revenue-per-session guardrail.

Common Mistakes

  • Reporting the mean on skewed data as if it were the center
  • Ignoring standard deviation — identical averages can have opposite stories
  • Treating correlation as proof of cause
  • Analyzing a biased sample then generalizing to everyone
  • Deleting outliers without documenting the reason
  • Calling a trivial effect 'significant' because the dataset is huge
  • Assuming normal distribution for revenue/income data (usually skewed)

Real-World Usage

Interviewers probe statistics basics because the cost of misuse is high: a manager who chases a "7% lift" that is actually noise spends budget on nothing. In daily work you will use medians and SDs for summaries, IQR to police data quality, distributions to choose charts and transforms, and significance/effect-size reasoning whenever someone compares two periods or two groups. Every data story you tell later rests on these numbers being honest.

Mini Project

Business problem: The delivery team claims the new last-mile partner made orders faster. The analyst must check this with statistics before the company signs a contract.

Dataset: any order-delivery log with delivery minutes and the partner flag (60–90+ orders across the two partners). Create one if needed.

Objective: an evidence-based verdict — is the new partner faster, similar, or within noise?

1

Task 1

Define the metric (delivery minutes) and filter invalid/missing records.
2

Task 2

Compute per-partner mean, median, SD, and IQR-based outlier check.
3

Task 3

Look at the distributions — are they skewed? Should you compare medians?
4

Task 4

Compute the difference and its relative size (the effect), and a 95% confidence interval if possible.
5

Task 5

Write a 4-line verdict: the real difference (if any), its practical size, and caution about lurking variables (area served?).
DeliverableProves
Per-partner summary tableMean/median/SD + IQR
Outlier investigationError vs genuine handling
Effect-size statementStatistical vs practical significance
Confidence intervalHonest uncertainty
Plain verdictAnalyst communication

Key Takeaways

  • Samples represent populations; bad samples create biased, confident lies
  • Median beats mean under skew; SD tells you how scattery the data is
  • Quartiles + IQR give a robust picture of spread and detect outliers
  • Distributions (normal vs skewed) decide your summary stats and charts
  • Outliers: detect → investigate → decide, and document every choice
  • Correlation measures co-movement, not cause
  • Significance answers 'likely luck?'; effect size answers 'worth acting on?'

Key Terms & Glossary

The vocabulary this topic uses, defined the way a working professional would.
TermMeaning
meanThe arithmetic average, sum divided by count, which is easily dragged upward by a few huge values.
medianThe middle value of the sorted data, and the honest centre for skewed distributions such as income or order amounts.
standard deviationA measure of spread in the data's own units, telling you whether values huddle near the mean or swing widely.
interquartile rangeThe middle 50% band of the data, Q3 minus Q1, used to describe typical spread and to drive the 1.5-times-IQR outlier rule.
p-valueThe probability of seeing a result at least this extreme if the null hypothesis were true; a small p-value means the result is unlikely to be sheer luck.
correlationA number from -1 to +1 measuring whether two variables move together — a measure of co-movement, never a proof of cause.

Learning Resources

These curated sources go deeper than this module: official docs, books, interactive practice, and full courses. Mix them into your routine to go from comfortable to professional.

StatQuest with Josh Starmer

The clearest statistics videos on the internet — mean, SD, p-values, correlation and more.

Open resource ↗

OpenIntro Statistics (Free Textbook)

A full, free introductory statistics textbook with exercises and datasets.

Open resource ↗

Khan Academy: Statistics and Probability

Free structured video course from distributions to hypothesis testing.

Open resource ↗

Scribbr — Descriptive Statistics

A friendly, example-driven reference on mean/median/mode, spread and percentiles.

Open resource ↗

Statistics by Jim

Intuitive, no-calculus explanations of skew, outliers, correlation and significance.

Open resource ↗

Seeing Theory

Interactive visuals that make distributions, probability and inference click.

Open resource ↗

Chapter Quiz

Put this lesson to work: answer the questions below, get instant feedback and a pass/fail score. Score 70% or higher before you move on — that is your gate to the next topic.

Chapter Quiz — Statistics for Data Analysis

Averages that don't lie, spread, distributions, correlation and chance — the statistics an analyst actually uses.

0 / 5

Question 1 of 5

For income data, which measure of center should you headline?

Knowledge Check

Income distributions are right-skewed — a few huge earners inflate the mean far above what a typical person earns, while the median stays in the middle of the actual population.
Q3−Q1, the middle 50% band of the data. It describes typical spread robustly and drives the 1.5×IQR rule for flagging outliers.
Ice-cream sales and drownings rise together in summer — temperature (a lurking variable) drives both. They correlate without causing each other.
That the observed result is unlikely to be pure chance (small p-value). It does NOT tell you the effect is large or worth acting on — check the size too.
Investigate before deciding: is it an error, an artifact, or a genuine event? Then flag, exclude (with documentation), cap, or analyze separately — never silently delete.

End-of-Topic Exam

Hint: One region dominates the total.

Model answer: The mean is the sum 1,460 divided by 5, which is 292; the median is the middle sorted value, 120. Report the median as the typical figure: revenue is right-skewed, so the giant region pulls the mean to 292 while 120 reflects a normal region. The mean still matters for the total pot, but a typical-region claim must use the median.

Hint: The fences sit at Q1 minus 1.5 times the IQR and Q3 plus 1.5 times the IQR.

Model answer: Q1 is 4.5 and Q3 is 9.5, so the IQR is 5. The lower fence is 4.5 minus 7.5, which is negative 3; the upper fence is 9.5 plus 7.5, which is 17. Only 34 lies beyond a fence, so exactly 34 is flagged as an outlier.

Hint: Temperature drives both — one hidden force.

Model answer: Correlation measures co-movement, not causation, and a third variable can drive both measures. The lurking variable is hot, sunny July weather, which increases both snow-cone buying and the time in the sun that produces sunburn. A controlled experiment or very strong domain logic would be needed before claiming a causal link.

Hint: Separate statistical significance from practical effect size.

Model answer: For test A: the lift is statistical, meaning it is unlikely to be luck, but it is practically tiny — 0.2% on that traffic may not pay for the rollout, so report the size, not just the p-value. For test B: the 2.0% gap looks large but the tiny sample cannot rule out noise, so the honest message is 'promising direction, not yet proven' — run it longer or on more traffic before spending money.

Next Step

Congratulations — you just finished Statistics for Data Analysis. The next topic is Data Cleaning & Preparation. Press on when you are ready: it will build directly on what you practiced here.