1/38
Looks like no tags are added yet.
Anscombe's quartet lesson
Four datasets with identical means, correlation (0.816), regression line (Y = 3 + 0.5X) and R² (0.67) look completely different. Always plot your data; summary stats can hide curves, outliers, and single-point leverage.
Anscombe (b), (c), (d)
(b) curved: a straight line is wrong, use a quadratic. (c) one outlier pulls the line. (d) the slope depends on one point.
Univariate analysis
Looking at one variable at a time: shape, center, spread, outliers.
Histogram weaknesses
Appearance depends on arbitrary bin width and start point; artificial jumps; loses detail within bins; poor for small samples.
Density estimate (kernel)
A smooth "moving histogram": a window slides along the data averaging nearby points; area = 1. No arbitrary bin edges.
Bandwidth
Window width of a density estimate. Too small = jagged, false peaks (undersmoothing). Too large = hides real features (oversmoothing).
Adaptive kernel
Narrow window where data are dense, wide where sparse; better for skewed data (smooth tail, detailed center).
Rug plot
Tick marks along the axis showing each observation's location.
Q-Q plot purpose
Compares sample quantiles with normal quantiles to check normality. Points on a straight line = normal. Best at showing tails.
Q-Q: points curve upward at the right end
Right (positive) skew.
Q-Q: points curve downward
Left (negative) skew.
Q-Q: S-shape (both ends pull away)
Heavy tails: more extreme values than normal.
Q-Q: inverse S
Light tails.
Q-Q confidence envelope
Approx. 95% band; if most points stay inside, normality is reasonable.
Boxplot parts
Box = Q1 to Q3 (middle 50%); line = median; whiskers to fences; points beyond = outliers. IQR = Q3 − Q1; fences = Q1 − 1.5·IQR and Q3 + 1.5·IQR.
Boxplot signs of right skew
Median near the bottom of the box; longer upper whisker; outliers only at the top.
Infant mortality (193 countries): describe distribution
Strongly right-skewed: most countries 10–20 deaths per 1,000, long tail to ~125; Q-Q curves upward; boxplot median low, long upper whisker. → Transform down the ladder (log).
Infant mortality vs. GDP scatterplot
Strong negative, nonlinear L-shape; both variables right-skewed so points crowd into a corner → log both.
Jittering
Adding small random noise to discrete data to reduce overplotting. For viewing only; never analyze jittered values.
Overplotting
Many points share the same (X, Y) and sit on top of each other (e.g., vocabulary vs. years of education).
Marginal vs. partial relationship
Marginal = X–Y ignoring other variables (scatterplot). Partial = X–Y holding other Xs constant (multiple regression).
Why a scatterplot matrix can't replace regression
It only shows marginal (pairwise) relationships; regression estimates partial effects.
Suppression effect
No marginal relationship but a partial one exists (e.g., study hours and SAT, controlling for ability).
Parallel boxplots: "groups with a higher level also have a bigger spread"
Spread increases with the median (level) → non-constant variance; suggests a log transformation.
Ladder of powers
Up: X³, X². No change: X. Down: √X, log X (the "zero power"), −1/√X, −1/X.
Fix right skew
Move DOWN the ladder (√X, log X).
Fix left skew
Move UP the ladder (X², X³).
Why logs fix right skew
They compress large values: 1, 10, 100, 1000 → 0, 1, 2, 3. Equal log gaps = equal multiplicative changes.
Symbox: choosing a transformation
Pick the most symmetric boxplot. For infant mortality, log X is most symmetric; −1/√X and −1/X over-correct into left skew.
Power transformation requirements
(1) All values positive (else add a constant). (2) max/min ratio > 2–3, otherwise the transformation does almost nothing.
Bulging rule (Mosteller & Tukey)
Move X and/or Y in the direction the curve bulges. Bulge up → Y up; down → Y down; right → X up; left → X down.
Prestige vs. income: bulge up-left
Transform X down (cube root of income) or Y up.
Infant mortality vs. GDP: bulge toward the bottom-left
Move both X and Y down → log both.
Log-log slope interpretation
Elasticity: a 1% increase in X is associated with about a B% change in Y. E.g., B = −0.5: 1% more GDP → 0.5% lower infant mortality.
log₂ and log₁₀ interpretation
log₂: +1 = doubling. log₁₀: +1 = ×10.
Logit formula
logit(p) = log(p / (1 − p)) = log(odds). Maps (0, 1) to (−∞, +∞); logit(0.5) = 0; symmetric.
When to use the logit
For proportions/percentages (rates, shares, vote %), especially when they span a wide range or variance depends on the mean.
Logit worked example: 60% vs. 80%
Odds 0.6/0.4 = 1.5 and 0.8/0.2 = 4.0; logits 0.41 and 1.39; odds ratio 4.0/1.5 = 2.67.
Logit at exactly 0 or 1
Undefined; nudge inward: p′ = (p·n + 0.5)/(n + 1).