"Statistics is the grammar of science." — Karl Pearson
Learning Objectives
By the end of this module, you will be able to:
- Calculate and interpret descriptive statistics (central tendency, spread, shape)
- Describe and apply probability distributions (normal, binomial, Poisson)
- Perform hypothesis tests (t-test, chi-square, ANOVA) and interpret results
- Calculate and explain confidence intervals
- Distinguish correlation from causation and avoid common statistical pitfalls
- Apply statistical thinking to real business problems
Why Statistics for Data Analysts?
Without statistics, analysis is sorting and plotting. With statistics you can say how surprised you should be by a gap, how wide plausible ranges are, and when noise looks like a pattern.
| Goal | Statistical idea |
|---|---|
| Typical value? | Mean, median, trimmed mean |
| Uncertainty? | Standard error, confidence interval |
| Real difference? | Hypothesis test + effect size |
| Relationship? | Correlation (carefully) |
Concept: A p-value is not “probability the null is true” — it’s how often you’d see data this extreme if the null story were true.
1. Descriptive Statistics
Measures of Central Tendency
Mean = balance point; median = middle sorted value; mode = most frequent. For skewed income-like data, median often matches “typical person” better than mean.
Measures of Spread
Range, variance, standard deviation (same units as data), IQR (Q3−Q1, robust). Coefficient of variation compares spread relative to the mean across scales.
Shape: Skewness and Kurtosis
Skewness: tail direction (>0 right-skew). Kurtosis: tail heaviness vs normal. Use plots — numbers alone lie softly.
2. Probability Distributions
Normal Distribution (Gaussian)
Bell curve; described by μ and σ. 68–95–99.7 rule for quick intuition. Many methods assume approximate normality; check with histograms / Q-Q plots.
Binomial Distribution
Count of successes in n fixed trials with probability p per trial — clicks, conversions, defectives.
Poisson Distribution
Count of rare events in fixed exposure — support tickets per hour, accidents per day. Mean ≈ variance at moderate λ.
| Distribution | Question it models |
|---|---|
| Normal | Continuous, symmetric-ish |
| Binomial | Yes/no counts out of n |
| Poisson | Event counts in an interval |
3. Hypothesis Testing
The Framework
H₀ = boring baseline (“no effect”). H₁ = what you seek. Pick α (often 0.05). Compute p-value; if p < α, reject H₀ — but always ask effect size and business meaning.
t-Test: Comparing Means
Two-sample for independent groups (A/B). Paired for before/after on same units. One-sample vs a benchmark.
Chi-Square Test: Comparing Proportions
Contingency tables — independence of two categoricals (segment vs tier).
ANOVA: Comparing 3+ Groups
Tests whether any group mean differs; follow with post-hoc pairwise tests and multiple-comparison correction if needed.
| Situation | Test direction |
|---|---|
| Two independent groups | Two-sample t-test (or Welch if variances differ) |
| Same subjects twice | Paired t-test |
| 3+ groups | ANOVA first, then corrected pairwise |
| Counts in categories | Chi-square / Fisher as appropriate |
Fun Fact: Six pairwise t-tests at α=0.05 can easily yield ~26% chance of some false alarm — that’s why ANOVA + correction exists.
4. Confidence Intervals
A CI gives a range of plausible parameter values from your sample. Wider = more uncertainty or higher confidence level. For proportions, use normal approximation when counts are healthy.
Try This! State a 95% CI for a mean in plain English without saying “95% probability the truth is in the range” — use the repeat the study interpretation.
5. Correlation
Correlation vs. Causation
Pearson = linear association. Spearman = monotonic (rank-based). Neither implies X causes Y.
The Causation Trap
Confounders create spurious correlation (ice cream and drownings ↔ summer). Experiments, timing, and domain knowledge fight this.
6. Effect Size and Practical Significance
Huge samples make tiny differences “significant.” Report Cohen’s d (or similar) and ask: “Would we change a decision for this magnitude?”
Key Example: Classic pattern — t-test p-value plus a standardized effect size so you don’t confuse statistical and practical wins.
[object Object], numpy ,[object Object], np
,[object Object], scipy ,[object Object], stats
rng = np.random.default_rng(,[object Object],)
control = rng.normal(,[object Object],, ,[object Object],, ,[object Object],)
treatment = rng.normal(,[object Object],, ,[object Object],, ,[object Object],)
t_stat, p_value = stats.ttest_ind(control, treatment)
pooled = np.sqrt(
(,[object Object], * control.std(ddof=,[object Object],) ** ,[object Object], + ,[object Object], * treatment.std(ddof=,[object Object],) ** ,[object Object],) / ,[object Object],
)
cohens_d = (treatment.mean() - control.mean()) / pooled
,[object Object],(,[object Object],)
,[object Object],(,[object Object],)
,[object Object],(,[object Object],)Practice Exercises
Exercise 1: Descriptive Statistics Report (Beginner)
500 salaries: mean, median, std, IQR, skewness; histogram with mean/median marked; interpret mean vs median gap.
Exercise 2: A/B Test Analysis (Intermediate)
Two conversion rates with equal n: test significance and CI for difference.
Exercise 3: Distribution Fitting (Intermediate)
Histogram + Q-Q + Shapiro / KS for normality call.
Exercise 4: Multi-Group Comparison (Advanced)
Five locations: ANOVA, post-hoc, box plots.
Exercise 5: Full Statistical Report (Advanced)
Full stack: descriptives, tests, CIs, effect sizes, visuals, non-technical summary.
Mini-Project: Marketing Campaign Analysis
Four channels: describe conversions and revenue, chi-square on conversion, ANOVA on revenue, correlations spend↔outcome, CIs for ROI, one-page exec summary.
Key Takeaways
- Describe before you infer; plots + summaries first.
- Match distribution to data-generating story.
- Pair p-values with effect sizes and CIs.
- Correlation is not causation — hunt confounders.
- “Significant” can still be negligible in business terms.
Resources for Further Learning
- Seeing Theory
- StatQuest with Josh Starmer
- Think Stats
- Khan Academy: Statistics
- Scipy.stats Documentation
- Statistics Done Wrong
Key Takeaway
- Summarize with mean/median/SD/IQR and always look at shape on a plot.
- Pick tests that match variable types and study design (paired vs independent).
- Report confidence intervals and effect sizes, not only p-values.
- Treat correlation as a hint, not proof of causation.
- Ask whether a statistically detectable change is large enough to act on.
Next up: Module 8 — Advanced Data Processing — level up your data wrangling with optimized Pandas and the blazing-fast Polars library.