Cheat sheet
Statistics & modelling for analyst interviews
Companion to the 162-question statistics bank. Definitions first, formulas second, interview language throughout.
Central tendency
| Definition | Use when | Excel | |
|---|---|---|---|
| Mean | sum ÷ n | Symmetric numbers | AVERAGE |
| Median | middle of sorted data (even n: average the 2 middles) | Skewed data or outliers (salaries, prices) | MEDIAN |
| Mode | most frequent | Categories | MODE.SNGL |
Right skew: mode < median < mean. Left skew: the reverse. Pair the mean with the standard deviation and the median with the IQR. [OpenStax 2.6]
Dispersion
| Range | max − min · easy, but driven by two points |
| IQR | Q3 − Q1 · spread of the middle 50% · resistant to outliers |
| Variance | mean of squared deviations · sample uses n − 1 |
| Standard deviation | √variance · same units as the data |
| z-score | (x − μ)/σ · mean 0, SD 1 · beyond ±3 is unusual |
| CV | SD/mean · compares relative spread across different units |
| Outlier rule | below Q1 − 1.5×IQR or above Q3 + 1.5×IQR |
Shift all values by c → SD unchanged. Multiply by c → SD × |c|, variance × c². Chebyshev: at least 1 − 1/k² within k SD (75% at k = 2). Normal: 68 / 95 / 99.7.
Probability
Rules
P(not A) = 1 − P(A)P(A∪B) = P(A) + P(B) − P(A∩B)
P(A|B) = P(A∩B)/P(B)
Independent: P(A∩B) = P(A)P(B)
Mutually exclusive: P(A∩B) = 0
Bayes
P(A|B) = P(B|A)P(A) / P(B)Base rates dominate. A 99% sensitive test for a 1% condition still gives mostly false positives.
Counting
nPr = n!/(n−r)! · nCr = n!/[r!(n−r)!]At least one = 1 − P(none).
Two children, at least one boy → P(both boys) = 1/3.
Expectation
E(aX + b) = aE(X) + b · E(X + Y) = E(X) + E(Y)Var(aX) = a²Var(X) · independent: Var(X+Y) = Var(X) + Var(Y).
Distributions
| Distribution | Use for | Mean · variance |
|---|---|---|
| Bernoulli(p) | One yes/no trial | p · p(1 − p) |
| Binomial(n, p) | Count of successes in n independent trials | np · np(1 − p) |
| Poisson(λ) | Count of events per unit time/area | λ · λ |
| Normal(μ, σ) | Symmetric continuous data; sample means via CLT | μ · σ² |
| Uniform(a, b) | Equally likely values in an interval | (a+b)/2 · (b−a)²/12 |
| Exponential(λ) | Waiting time between Poisson events | 1/λ · 1/λ² |
Standard normal: P(Z < 0) = 0.5 · P(|Z| < 1.96) = 0.95 · P(Z > 1.645) ≈ 0.05 (one tail).
Sampling & the CLT
Standard error
SE = σ/√n. It measures the precision of a sample estimate. Quadrupling n halves the margin of error.Central Limit Theorem
For large n, the sampling distribution of the mean is approximately normal and centred at μ, whatever the population shape.95% CI (known σ)
x̄ ± 1.96 × σ/√n. The procedure captures μ 95% of the time; this interval either does or does not.Bias vs variance
Random sampling reduces bias. Increasing n reduces variance/SE. A bigger biased sample is still biased.Hypothesis testing
| H₀ true | H₀ false | |
|---|---|---|
| Reject H₀ | Type I · false positive · α | Correct · power = 1 − β |
| Fail to reject H₀ | Correct · 1 − α | Type II · false negative · β |
- p-value = P(data this extreme | H₀ true). p ≤ α → reject. Never "accept H₀".
- α = 0.05 typical. Lowering α raises β. A bigger sample lowers both and raises power.
- Two-tailed p ≈ 2 × one-tailed p. Choose the direction before seeing data.
- Statistically significant ≠ practically important. Report an effect size.
- Testing many hypotheses inflates false positives: expected false positives ≈ m × α. Use Bonferroni or FDR.
Which test?
| Question | Test |
|---|---|
| One mean vs a value, σ unknown | One-sample t-test |
| Two independent group means | Independent two-sample t-test |
| Before/after on the same units | Paired t-test |
| Three or more group means | One-way ANOVA (then post-hoc) |
| Association between two categorical variables | Chi-square test |
| Non-normal two-group comparison | Mann–Whitney U |
Correlation & regression
Correlation
r ∈ [−1, 1], unitless, measures linear association. r = 0 ≠ no relationship. Sensitive to outliers. Spearman for monotonic/ordinal.Regression
y = a + bx. Slope = change in y per 1-unit change in x. Residual = actual − predicted. OLS minimises the sum of squared residuals.R²
Proportion of variance in y explained. In simple regression R² = r². Adding predictors never lowers R², so use adjusted R² to compare models.Watch for
Extrapolation · influential points · confounding · regression to the mean · Anscombe's quartet (same stats, different plots).Multicollinearity
What · why
Predictors correlated with each other (age and experience). It gives unstable coefficients and inflated standard errors. Prediction is often still OK.Detect · fix
Correlation matrix · VIF = 1/(1 − R²ⱼ): 1 none, >4–5 investigate, >10 serious. Fix: drop, combine/PCA, ridge. Dummy trap: use k − 1 dummies.[Penn State STAT 462] · Lessons: 6 · 7 · 8
Business-stat traps
| Simpson's paradox | A trend in every subgroup reverses when the groups are pooled. |
| Base rate fallacy | Ignoring prevalence. Rare events produce many false positives even with accurate tests. |
| Survivorship bias | Analysing only the units that survived; failures are missing. |
| Confounding | A third variable affects both treatment and outcome, creating a spurious link. |
| Selection bias | The sample is not representative because entry is related to the variables studied. |
| Data leakage | Training data contains information not available at prediction time; test scores look great, production fails. |
| Average of ratios | Weight rates by their denominators; a simple mean of store conversion rates misleads. |
| Novelty effect | An A/B lift that fades once users get used to the change. |