Skip to content

Quiz 4:Regression Models (Data Science Specialization) Answers 2025

1. Question 1

Space Shuttle data — Logistic regression for use ~ wind
Odds ratio for autolander use comparing head (numerator) vs tail (denominator):

1.327
❌ 0.969
❌ 0.031
❌ -0.031

Explanation:
A logistic regression on the shuttle dataset (MASS library) gives an estimated odds ratio ≈ 1.327, meaning autolander use is about 32.7% more likely with head winds vs tail winds.


2. Question 2

Adjusted for wind strength (magn):

0.969
❌ 1.485
❌ 0.684
❌ 1.00

Explanation:
After adjusting for wind magnitude, the odds ratio drops close to 1 (≈ 0.969), indicating that after accounting for strength, wind direction (head vs tail) doesn’t significantly change autolander use.


3. Question 3

What happens to coefficients if we fit the model for 1 – outcome (e.g., “not using autolander”)?

The coefficients reverse their signs.
❌ The intercept changes sign, but the others don’t.
❌ The coefficients get inverted.
❌ The coefficients change in a non-linear fashion.

Explanation:
For a logistic model, flipping the binary outcome (1 ↔ 0) inverts the log-odds, so all regression coefficients change sign (β → -β).


4. Question 4

InsectSprays Poisson model comparing Spray A (numerator) vs Spray B (denominator):

0.321
❌ -0.056
❌ 0.136
❌ 0.9457

Explanation:
The relative rate (exp(β_A–β_B)) ≈ 0.321 → Spray A’s insect count rate is roughly 32% of Spray B’s rate (i.e., A is more effective).


5. Question 5

Poisson model with offset t vs modified offset t2 = log(10) + t: what happens to coefficient for x?

The coefficient estimate is unchanged
❌ Multiplied by 10
❌ Divided by 10
❌ Subtracted by log(10)

Explanation:
Adding a constant to an offset shifts the intercept (by that constant) but leaves the slope coefficients (like for x) unchanged — offsets adjust baseline, not relative effects.


6. Question 6

“Hockey-stick” regression with knot at x=0:
y=β0+β1x+β2(x>0)(x−0)y = β_0 + β_1x + β_2(x>0)(x-0)

1.013
❌ -0.183
❌ 2.037
❌ -1.024

Explanation:
Before the knot, slope ≈ -0.18; after 0, slope = β₁ + β₂ ≈ 1.013, showing the line “bends up” at x=0 — the right-side slope is ≈ 1.013.


🧾 Summary Table

Q# ✅ Correct Answer Key Concept
1 1.327 Head vs tail odds ratio (unadjusted)
2 0.969 Adjusted odds ratio ≈ 1 after accounting for wind strength
3 Coefficients reverse sign Flipping binary outcome reverses β signs
4 0.321 Relative rate Spray A vs B (Poisson model)
5 Coefficient unchanged Offset shift affects intercept only
6 1.013 “After knot” slope in hockey-stick model