MSCA 602 Session 5 (Reworded): Dummy-Variable Regression & ANOVA

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

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

41 Terms

1
New cards

What is a dummy variable?

A variable coded 1 if the observation is in a category and 0 if not (e.g., male = 1, female = 0). It lets a categorical variable enter a regression.

2
New cards

Why include a categorical variable (like sex or occupation type) in a regression?

(1) It can explain extra variation in Y (smaller errors, higher R²). (2) If it is related to both Y and an included X, leaving it out causes omitted variable bias.

3
New cards

Plot: income vs. education, separate parallel lines for men and women, and both sexes have the SAME education levels. What happens if you ignore sex?

The pooled line has the same slope as the group lines, so the education effect is not biased. But much variation is left unexplained (the gap between men and women ends up in the errors).

4
New cards

Plot: income vs. education, separate parallel upward lines for men and women, but women have MORE education and lower income. What happens if you ignore sex?

Pooling the groups can make the line slope DOWN even though education raises income in each group. This is omitted variable bias: sex is related to both education and income.

5
New cards

Additive dummy model: Y = α + βX + γD. Write the line for each group.

D = 0 (baseline): Y = α + βX. D = 1: Y = (α + γ) + βX. Same slope β → parallel lines. γ = the constant vertical gap between the groups.

6
New cards

How do you interpret a dummy coefficient γ?

"Holding X constant, [group coded 1] has on average γ more (or less) Y than [baseline group]."

7
New cards

What is the baseline (reference) category?

The group coded 0 on every dummy. Every dummy coefficient is a comparison WITH this group.

8
New cards

What happens if you switch which group is coded 1?

γ keeps its size but flips sign; the fitted lines and predictions are identical.

9
New cards

How many dummies does a categorical variable with m categories need?

m − 1. One category is left out as the baseline. Example: 3 occupation types → 2 dummies.

10
New cards

What is the dummy variable trap?

Including all m dummies plus the intercept. The dummies always add to 1, which equals the intercept column → perfect collinearity → no unique solution (R shows NA).

11
New cards

Davis data (measured weight on reported weight + sex): sexM = −0.499, p = 0.299. Interpret and test.

"Holding reported weight constant, men's measured weight is on average 0.50 kg lower than women's." H₀: γ = 0 (no sex difference). p = 0.299 > 0.05 → fail to reject H₀: no evidence that men and women differ once reported weight is accounted for.

12
New cards

Prestige data (98 Canadian occupations; prestige score, income in $, education in years, type = blue collar, white collar, professional): additive model coefficients?

Intercept −0.62; income 0.001013 per $; education 3.673 per year; prof 6.04 (p = 0.12); wc −2.74 (p = 0.28). Blue collar is the baseline.

13
New cards

Prestige additive model: give the intercept for each occupation type

Blue collar: −0.62. Professional: −0.62 + 6.04 = 5.42. White collar: −0.62 − 2.74 = −3.36. All share the same income and education slopes → parallel planes.

14
New cards

Prestige additive model: prof = 6.04. Interpret.

"Holding income and education constant, professional occupations have on average 6.04 more prestige points than blue-collar occupations."

15
New cards

Formula for the incremental (nested) F-test

F = [(R²full − R²reduced) / q] ÷ [(1 − R²full) / (n − k − 1)], or with RSS: [(RSSreduced − RSSfull) / q] ÷ [RSSfull / (n − k − 1)]. q = number of terms being tested; k and df come from the FULL model.

16
New cards

Prestige data: does occupation type matter? R² = 0.835 with type, 0.814 without; n = 98, full model k = 4, q = 2.

H₀: γprof = γwc = 0 (type adds nothing). F = (0.021 / 2) ÷ (0.165 / 93) = 0.0105 / 0.00177 ≈ 5.87, p = 0.004 < 0.05 → reject H₀. Holding income and education constant, occupation type matters.

17
New cards

Neither type dummy is significant alone, but the joint F-test for type is. How?

Each t-test only compares one group with the baseline. The joint F-test asks whether the categorical variable matters at all, and its result doesn't depend on which group is the baseline.

18
New cards

When do you use a t-test vs. an incremental F-test?

One coefficient → t-test (or F with q = 1; then F = t²). Several coefficients together (all dummies of a factor, a set of interaction terms) → incremental F-test.

19
New cards

What is an interaction?

The effect of one X on Y depends on the value of another variable. On a plot: NON-PARALLEL lines. It works both ways.

20
New cards

Interaction vs. correlation between Xs

Correlation: the Xs are related to each other (e.g., women have more education). Interaction: one X changes the EFFECT of another X on Y (e.g., education raises income more for men). Either can happen without the other.

21
New cards

Interaction model: Y = α + βX + γD + δ(X·D). Write the line for each group.

D = 0: Y = α + βX. D = 1: Y = (α + γ) + (β + δ)X. δ = the difference in slopes between the groups.

22
New cards

How do you test for an interaction?

H₀: δ = 0 (same slope in both groups → parallel lines). Hₐ: δ ≠ 0 (slopes differ). For several interaction terms use an incremental F-test.

23
New cards

In an interaction model, what do β and γ mean?

β = the slope for the BASELINE group only. γ = the group gap only at X = 0, which is often outside the data and meaningless.

24
New cards

What is the principle of marginality?

(1) Check the interaction first. (2) If it is significant, don't interpret the main effects by themselves; describe the effect group by group. (3) Always keep the main effects when the interaction is in the model. (4) If the interaction is not significant, drop it and use the additive model.

25
New cards

Davis data with an interaction: repwt:sexM = −0.008, p = 0.832. Interpret.

Women's slope = 0.977; men's slope = 0.977 − 0.008 = 0.969. p = 0.832 > 0.05 → fail to reject H₀: δ = 0. No evidence that the reported-to-measured relationship differs by sex → parallel lines → use the additive model.

26
New cards

How do you read interaction rows in regression output?

Rows without a colon are for the BASELINE group. Rows with a colon (e.g., income:typeprof) are the DIFFERENCE from the baseline. Add them to get each group's slope.

27
New cards

Prestige interaction model: income slopes are blue collar 0.00352, income:prof −0.00290, income:wc −0.00207. Get each group's slope and interpret.

Blue collar 0.00352; professional 0.00352 − 0.00290 = 0.00062; white collar 0.00352 − 0.00207 = 0.00145. Per $1,000: 3.5, 0.6 and 1.5 prestige points. Income raises prestige most for blue-collar jobs and least for professional jobs.

28
New cards

Prestige interaction model: education slopes are blue collar 1.71, education:prof +1.39, education:wc +4.29. Get each group's slope.

Blue collar 1.71; professional 1.71 + 1.39 = 3.10; white collar 1.71 + 4.29 = 6.00 prestige points per extra year of education. Education matters most for white-collar jobs.

29
New cards

Type-II ANOVA table for the prestige interaction model: income:type F = 11.92, p < 0.001. Interpret.

H₀: the income slope is the same for all three types. p < 0.001 → reject. Holding education constant, the effect of income on prestige differs by occupation type. Don't interpret the income main effect by itself.

30
New cards

Type-II ANOVA table: education:type F = 2.99, p = 0.056. Interpret.

p = 0.056 > 0.05 → fail to reject at 5%. Only weak evidence that the education effect differs by occupation type.

31
New cards

What are Type-II tests?

Each term is tested after all other terms EXCEPT its own higher-order interactions. They respect marginality. Read the interaction rows first.

32
New cards

Effect plot: prestige vs. income with a separate line for each occupation type; the lines are not parallel. What does it show?

An interaction: the income effect depends on type. For the prestige data, the blue-collar line is steepest and the professional line is flattest.

33
New cards

Why is it risky to drop every non-significant term?

"No evidence of an effect" is not "evidence of no effect" (the test may lack power), and dropping a confounder biases the other coefficients.

34
New cards

Why is it risky to keep only the significant terms?

Many tests → some are significant by chance (false positives). With a large n, tiny unimportant effects become significant.

35
New cards

What is adjusted R², and how is it used?

Adjusted R² = 1 − [(n − 1)/(n − s)] × RSS/TSS, where s = number of parameters including the intercept. It penalizes extra parameters; choose the model with the highest value. Prestige: additive 0.828 vs. interaction 0.863 → keep the interactions.

36
New cards

What is a one-way ANOVA in regression terms?

A regression whose only regressors are the dummies for one categorical variable. It compares the group means.

37
New cards

In a one-way ANOVA regression, what do the intercept and dummy coefficients mean?

Intercept α = the mean of the baseline group. Each γⱼ = (mean of group j) − (mean of the baseline group).

38
New cards

What is the null hypothesis of a one-way ANOVA?

H₀: all group means are equal (μ₁ = μ₂ = μ₃), which is the same as all dummy coefficients = 0. Tested with the F-test.

39
New cards

Duncan data, one-way ANOVA of logit(prestige) by occupation type: SS type = 95.55 (df 2), SS residual = 38.60 (df 42). Compute F and R².

MS type = 95.55/2 = 47.78; MS residual = 38.60/42 = 0.919. F = 47.78/0.919 = 51.98, p < 0.001 → reject H₀: mean prestige differs across types. R² = 95.55/(95.55 + 38.60) = 95.55/134.15 = 0.71.

40
New cards

Duncan ANOVA coefficients on logit(prestige): intercept −1.48, prof 3.11, wc 0.89 (p = 0.051). Interpret.

Intercept = mean logit for blue collar ≈ 18.5% rating "good." prof = 3.11 → e^3.11 ≈ 22, so professional jobs have about 22 times the odds of a "good" rating compared with blue-collar jobs. wc is borderline (p = 0.051 > 0.05): not significant at 5%.

41
New cards

Why use logit(prestige) for the Duncan ANOVA?

Duncan prestige is a percentage (0–100). Blue-collar jobs crowd near 0 and professional jobs near 100, causing skew and unequal spreads across groups. The logit removes the limits, making distributions more symmetric with more equal spreads.