MSCA 602 Session 2 (Reworded): Examining & Transforming Data

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

39 Terms

1
New cards

What is the lesson of Anscombe's quartet?

Four datasets have the SAME mean, correlation (0.816), regression line (Y = 3 + 0.5X) and R² (0.67), but their scatterplots look completely different. Lesson: always plot the data. Summary statistics can hide curves, outliers and single points that control the line.

2
New cards

Anscombe's quartet: describe the 3 problem plots

One is a smooth curve → a straight line is the wrong model (use a quadratic). One is a tight straight line except for one outlier that pulls the line. One has all points at the same X except one far point → the slope depends entirely on that single point.

3
New cards

What is univariate analysis?

Examining one variable at a time: its shape (symmetric, skewed, peaks), center, spread and outliers. Done before regression to spot problems.

4
New cards

What are the weaknesses of a histogram?

Its look depends on arbitrary choices (bin width, start point); it has artificial jumps; it loses detail within bins; it is unreliable for small samples.

5
New cards

What is a kernel density estimate?

A smooth "moving histogram": a window slides along the data and averages nearby points, producing a smooth curve with total area = 1. No arbitrary bin edges.

6
New cards

What is the bandwidth of a density estimate, and what goes wrong if it is too small or too large?

The width of the sliding window. Too small: jagged curve with false peaks (undersmoothing). Too large: hides real features such as a second peak (oversmoothing).

7
New cards

What is an adaptive kernel density estimate?

The window is narrow where data are dense and wide where data are sparse. Better for skewed data: detailed in the crowded center, smooth in the thin tail.

8
New cards

What is a rug plot?

Small tick marks along the axis, one per observation, showing exactly where the data points are.

9
New cards

What is a Q-Q (normal quantile) plot used for, and what does "normal" look like?

It plots the data's quantiles against the quantiles of a normal distribution to check normality. If the data are normal, the points fall on a straight line. It is especially good at showing the tails.

10
New cards

Q-Q plot: the points bend UPWARD away from the line at the right end. Meaning?

Right (positive) skew: the largest values are bigger than a normal distribution would produce. Fix: move down the ladder of powers (log or √).

11
New cards

Q-Q plot: the points bend DOWNWARD away from the line. Meaning?

Left (negative) skew: the low values stretch farther than normal. Fix: move up the ladder of powers (square, cube).

12
New cards

Q-Q plot: S-shape — the low end falls below the line and the high end rises above it. Meaning?

Heavy tails: more extreme values at both ends than a normal distribution. The mean and least-squares estimates are less stable.

13
New cards

Q-Q plot: inverse S-shape (both ends flatten toward the line). Meaning?

Light tails: fewer extreme values than a normal distribution.

14
New cards

What is the confidence envelope on a Q-Q plot?

An approximate 95% band around the line. If most points stay inside the band, normality is reasonable; points outside indicate departures.

15
New cards

What are the parts of a boxplot?

Box = Q1 to Q3 (middle 50% of data); line inside = median; IQR = Q3 − Q1; fences = Q1 − 1.5·IQR and Q3 + 1.5·IQR; whiskers extend to the most extreme points inside the fences; individual dots beyond = outliers.

16
New cards

How do you spot right skew in a boxplot?

Median close to the BOTTOM of the box, upper whisker much longer than the lower one, outliers only at the top.

17
New cards

Infant mortality for 193 countries: histogram piles up at 10–20 deaths per 1,000 with a long tail to about 125; the Q-Q plot curves upward; the boxplot has a low median and long upper whisker. Describe and suggest a fix.

Strongly right-skewed: most countries have low infant mortality, a few have very high values. Fix: move down the ladder of powers, usually log(infant mortality).

18
New cards

Scatterplot: infant mortality (Y) vs. GDP per capita (X) for countries. The points form an L-shape crowded into the bottom-left corner. Interpret.

Strong negative, nonlinear relationship: infant mortality drops fast as GDP rises from very low levels, then flattens. Both variables are right-skewed, so points crowd into one corner. Fix: take logs of both variables.

19
New cards

What is jittering, and when is it used?

Adding small random noise to discrete values (e.g., years of education, vocabulary scores) so points that sit on top of each other become visible. Only for viewing; never analyze the jittered values.

20
New cards

What is overplotting?

Many observations share the same (X, Y) values and are drawn on top of each other, so the plot hides how many points are really there.

21
New cards

Marginal vs. partial relationship

Marginal: X and Y ignoring all other variables (what a simple scatterplot shows). Partial: X and Y holding the other Xs constant (what a multiple regression coefficient measures). They can differ a lot.

22
New cards

Why can't a scatterplot matrix replace a multiple regression?

A scatterplot matrix only shows marginal (pairwise) relationships. It cannot show the partial effect of one X holding the others constant, which is what regression estimates.

23
New cards

What is a suppression effect?

X shows little or no marginal relationship with Y, but a clear partial relationship once another variable is controlled. Example: study hours and SAT score look unrelated until you control for prior ability.

24
New cards

Parallel boxplots of one variable for several groups: groups with a higher median also have a bigger box (spread). Meaning and fix?

Spread increases with level → non-constant variance across groups. Fix: a log transformation, which shrinks large values more and evens out the spreads.

25
New cards

What is the ladder of powers?

An ordered list of transformations. Up: X³, X². No change: X¹. Down: √X, log X (plays the role of the "zero" power), −1/√X, −1/X. Going down compresses big values more and more.

26
New cards

Which direction on the ladder fixes RIGHT skew?

DOWN the ladder: √X, then log X, then −1/X (each step stronger).

27
New cards

Which direction on the ladder fixes LEFT skew?

UP the ladder: X², then X³.

28
New cards

Why does a log transformation fix right skew?

It compresses large values: 1, 10, 100, 1000 → 0, 1, 2, 3. The long right tail is pulled in. Equal steps on the log scale = equal percentage (multiplicative) changes.

29
New cards

Symbox (boxplots of the same variable under several transformations): how do you pick one?

Choose the transformation whose boxplot is most symmetric. For infant mortality, log is most symmetric; −1/√X and −1/X overcorrect and create left skew.

30
New cards

When does a power transformation work?

(1) All values must be positive (if not, add a constant first). (2) The ratio of largest to smallest value should be more than about 2–3; otherwise the transformation barely changes anything.

31
New cards

What is the bulging rule (Mosteller & Tukey)?

Look at which way the curve bulges and move X and/or Y on the ladder in that direction. Bulge up → move Y up; bulge down → move Y down; bulge right → move X up; bulge left → move X down.

32
New cards

Prestige (Y) vs. income (X): the curve rises steeply then flattens (bulges up and to the left). Which transformations?

Move X down the ladder (e.g., log or cube root of income) or move Y up. Most common: log(income).

33
New cards

Infant mortality (Y) vs. GDP (X): curve bulges toward the bottom-left corner. Which transformations?

Move both X and Y down the ladder → log both. The plot of log(infant mortality) vs. log(GDP) becomes roughly a straight line.

34
New cards

How do you interpret the slope in a log-log regression?

As an elasticity: a 1% increase in X is associated with an average change of about B% in Y. Example: B = −0.5 → a 1% increase in GDP per capita is associated with about a 0.5% decrease in infant mortality.

35
New cards

How do you interpret a 1-unit increase in log₂(X) or log₁₀(X)?

log₂: +1 means X doubles. log₁₀: +1 means X is multiplied by 10. So the slope = change in Y when X doubles (log₂) or grows tenfold (log₁₀).

36
New cards

What is the logit transformation?

logit(p) = log(p / (1 − p)) = log of the odds. It stretches a proportion from (0, 1) onto (−∞, +∞); logit(0.5) = 0; it is symmetric around 0.5.

37
New cards

When should you use the logit?

For proportions or percentages (rates, shares, vote %), especially when values cover a wide range or crowd near 0 or 1, because the spread then depends on the level.

38
New cards

Logit calculation: compare 60% and 80%

Odds: 0.6/0.4 = 1.5 and 0.8/0.2 = 4.0. Logits: log(1.5) = 0.41 and log(4.0) = 1.39. Odds ratio: 4.0/1.5 = 2.67, so the odds are 2.67 times higher at 80%.

39
New cards

What do you do if a proportion is exactly 0 or 1 before taking the logit?

The logit is undefined there, so nudge the value inward, e.g., p′ = (p·n + 0.5)/(n + 1).