Module 15

Multiple Regression

Predicting with multiple variables

Multiple Predictors

  • 01

    The Equation

    Multiple X variables

  • 02

    Partial Effects

    Controlling for other variables

  • 03

    Multicollinearity

    When predictors are correlated

  • 04

    Model Building

    Choosing which variables to include

01

The Multiple Regression Equation

Adding More Predictors

ŷ = b₀ + b₁x₁ + b₂x₂ + ... + bₖxₖ
With k predictors
Example (Salary prediction):

Salary = 30,000 + 2,500(Years) + 5,000(Degree) + 1,000(Certifications)

Where:
• Years = years of experience
• Degree = 1 if graduate degree, 0 otherwise
• Certifications = number of professional certifications

Multiple regression uses several predictors. Each coefficient (b₁, b₂, etc.) shows the effect of that variable while holding others constant.

From Line to Plane (and Beyond)

Simple Regression
1 predictor = Line
Multiple (2 predictors)
2 predictors = Plane
3+ predictors = Hyperplane (can't visualize, but math works the same)

With 1 predictor, we fit a line. With 2 predictors, we fit a plane in 3D space. With more predictors, we fit a hyperplane in higher dimensions—same principle, just harder to visualize.

Adjusted R-Squared

Problem with R²
R² always increases when you add predictors—even useless ones!
Solution: Adjusted R²
Penalizes for extra predictors. Only increases if new variable improves fit enough.
Adj R² = 1 - [(1-R²)(n-1)/(n-k-1)]

Regular R² always goes up with more predictors. Adjusted R² penalizes for model complexity—it only increases if the new variable genuinely improves prediction. Always report adjusted R² for multiple regression.

02

Partial Effects

Holding Other Variables Constant

Salary = 30,000 + 2,500(Years) + 5,000(Degree)

Interpretation of b₁ = 2,500:
"Among people with the same degree status, each additional year of experience is associated with $2,500 higher salary."
This is the partial effect of Years, controlling for Degree

Each coefficient shows the effect of that variable while holding all other variables constant. This lets us isolate the unique contribution of each predictor.

Confounding and Control

Simple Regression
Ice cream sales → Drownings
b = 0.8 (significant)

Looks like ice cream causes drowning!
Multiple Regression
Add temperature as control:

Ice cream effect: b = 0.1 (n.s.)
Temperature effect: b = 0.7 (sig.)

Temperature was the confounder!

Multiple regression helps identify confounders. When we control for temperature, the ice cream-drowning relationship disappears—temperature was driving both. This is statistical 'control.'

Testing Individual Predictors

t-test for each coefficient
H₀: bᵢ = 0 (no effect after controlling for others)
Hₐ: bᵢ ≠ 0 (significant unique contribution)

t = bᵢ / SE(bᵢ)
PredictorbSEtp
Years25004006.25<.001
Degree500012004.17<.001

Each coefficient has its own t-test. A significant p-value means that predictor contributes unique information beyond the other predictors. Non-significant doesn't mean unimportant—could be redundant with others.

03

Multicollinearity

When Predictors Are Correlated

Low Correlation
Easy to separate effects
High Correlation
Effects entangled

When predictors are highly correlated, it's hard to separate their individual effects. The model can't tell which variable is responsible for the outcome.

Signs of Multicollinearity

🚨 Large standard errors
Coefficients become imprecise
🚨 Unstable coefficients
Small data changes → big coefficient changes
🚨 Counterintuitive signs
Coefficients opposite to expected direction
🚨 High R², no significant predictors
Model fits well but can't identify which variable matters

Symptoms include inflated standard errors, unstable coefficients, and counterintuitive signs. The overall model may fit well (high R²), but individual predictors aren't significant.

Variance Inflation Factor

VIF = 1 / (1 - R²ᵢ)
R²ᵢ = how well other predictors predict Xᵢ
VIF < 5
OK
VIF 5-10
Moderate
VIF > 10
Severe

VIF measures how much a coefficient's variance is inflated due to collinearity. VIF = 1 means no correlation with other predictors. VIF > 10 indicates severe multicollinearity.

Dealing with Multicollinearity

1. Remove a variable
Drop one of the correlated predictors
2. Combine variables
Create composite score (e.g., average)
3. Center variables
Helps with interaction terms
4. PCA
Use principal components as predictors

Options include removing redundant predictors, combining them into composites, centering (especially for interactions), or using PCA to create uncorrelated predictors.

04

Model Building

Variable Selection Methods

Forward Selection
Start empty → add best predictor → repeat until no improvement
Backward Elimination
Start with all → remove worst predictor → repeat until all significant
Stepwise
Combination: add and remove at each step

Automated methods can help select variables, but they have limitations. They can capitalize on chance and find 'best' models that don't replicate. Theory-driven selection is often preferred.

Comparing Models

CriterionFormulaLower = Better?
Adjusted R²Penalizes for kNo (higher better)
AIC-2ln(L) + 2kYes
BIC-2ln(L) + k·ln(n)Yes
Mallows' CpSSE/MSE + 2k - nYes (close to k)
k = number of predictors, n = sample size, L = likelihood

Information criteria (AIC, BIC) balance fit with parsimony. BIC penalizes complexity more heavily than AIC. Compare models with the same outcome variable; lower AIC/BIC = better.

Model Building Guidelines

✓
Theory first: Include variables based on theory, not just data
✓
Sample size: Need ~15-20 observations per predictor
✓
Check assumptions: Residual plots, normality, multicollinearity
✓
Cross-validate: Test on holdout data or use k-fold CV
✓
Report everything: Including non-significant predictors

Good practice: use theory to guide variable selection, ensure adequate sample size, check all assumptions, validate on new data, and report the full model (not just significant predictors).

★

Real-World Examples

Apply your knowledge to practical scenarios

01

Predicting Employee Salaries

HR builds a salary prediction model: Salary = 30,000 + 2,000(Experience) + 8,000(Degree) + 500(Training). Where Experience is in years, Degree = 1 if graduate degree (0 otherwise), Training = number of certifications. Adjusted R² = 0.72.

Sample Data
{
  "n": 200,
  "predictors": 3,
  "adj_r_squared": 0.72
}
Q Interpret the coefficient for Experience (b = 2,000). +
A Holding degree and training constant, each additional year of experience is associated with $2,000 higher salary on average. This is the PARTIAL effect of experience.
Q Two employees have the same experience and training, but one has a graduate degree. What's the predicted salary difference? +
A $8,000. The Degree coefficient shows the salary premium for having a graduate degree, controlling for experience and training.
Q Simple regression of Salary on Experience alone gives b = 3,500. Why is it higher than the multiple regression coefficient (2,000)? +
A Confounding! People with more experience also tend to have more degrees and training. Simple regression attributes their salary premium to experience alone. Multiple regression partials out the shared variance.
Q Can we conclude that getting a graduate degree will CAUSE a $8,000 salary increase? +
A No! Regression shows association, not causation. People who get graduate degrees may differ in other ways (ambition, ability, field) not captured in our model. These could be the true cause.
Key Insights
  • Multiple regression coefficients are 'partial' effects—controlling for other variables
  • Coefficients often change between simple and multiple regression
  • Regression doesn't prove causation—unmeasured confounders may exist
02

Unmasking the Ice Cream-Drowning Confounder

Simple regression shows Ice Cream Sales significantly predicts Drowning Deaths (b = 0.8, p < 0.01). But when we add Temperature to the model, the results change dramatically.

Sample Data
{
  "simple_model": {
    "ice_cream_b": 0.8,
    "ice_cream_p": 0.001
  },
  "multiple_model": {
    "ice_cream_b": 0.05,
    "ice_cream_p": 0.72,
    "temperature_b": 1.2,
    "temperature_p": 0.001
  }
}
Q What happened to the ice cream coefficient when temperature was added? +
A It dropped from 0.8 to 0.05 and became non-significant (p = 0.72). Controlling for temperature, ice cream sales has essentially no relationship with drowning.
Q What does this tell us about the original relationship? +
A Temperature was a confounder. It caused both more ice cream sales AND more swimming (leading to drownings). The ice cream-drowning correlation was spurious—driven entirely by temperature.
Q Why is multiple regression so valuable here? +
A It allows statistical 'control' for confounders. Without multiple regression, we might wrongly conclude ice cream causes drowning. With it, we identify temperature as the true driver.
Q Does this prove temperature CAUSES drownings? +
A It's stronger evidence, but still not proof. There could be other confounders (holidays, weekends, school schedules) correlated with both temperature and drowning. Causation requires experimental design.
Key Insights
  • Adding controls can make spurious relationships disappear
  • Multiple regression helps identify true predictors vs. confounders
  • Always consider: 'What third variable could explain this?'
03

The Multicollinearity Trap

A researcher predicts test scores from Hours_Studied and Practice_Problems. Both are strongly correlated with test scores individually (r = 0.7 each), but in the multiple regression model, neither is significant (p > 0.05 for both). R² = 0.52.

Q How can both predictors be non-significant when R² = 0.52 (decent model fit)? +
A Multicollinearity! Hours_Studied and Practice_Problems are probably highly correlated with each other (studying more → doing more problems). The model can't separate their effects.
Q What statistical diagnostics would confirm this? +
A Calculate VIF (Variance Inflation Factor). If VIF > 10, there's severe multicollinearity. Also check the correlation between Hours_Studied and Practice_Problems.
Q The correlation between Hours_Studied and Practice_Problems is r = 0.92. What should the researcher do? +
A Options: (1) Remove one variable—keep the more theoretically important one; (2) Combine them into a single 'Total Study Effort' composite; (3) Use Principal Component Analysis.
Q If the goal is just prediction (not interpretation), does multicollinearity matter? +
A Less so. Predictions can still be good even with multicollinearity. But coefficient interpretation becomes unreliable, and the model is unstable—small data changes cause big coefficient swings.
Key Insights
  • Multicollinearity: correlated predictors make individual coefficients unreliable
  • Symptoms: high R² but non-significant predictors, large SEs, unstable coefficients
  • VIF > 10 indicates serious multicollinearity problems
?

Multiple Regression Quiz

Test your understanding • Passing score: 70%

0 of 10 answered
Q1 multiple-choice

In multiple regression, what does 'holding other variables constant' mean?

Explanation: Each coefficient shows the effect of that predictor while statistically 'controlling for' (holding constant) all other predictors. This isolates each variable's unique contribution.
Q2 multiple-choice

Why should you use adjusted R² instead of R² for multiple regression?

Explanation: R² automatically increases when you add predictors, even if they don't truly improve prediction. Adjusted R² penalizes for extra predictors, only increasing if they genuinely help.
Q3 multiple-choice

What is multicollinearity?

Explanation: Multicollinearity occurs when predictor variables are highly correlated with each other. This makes it difficult to separate their individual effects on the outcome.
Q4 multiple-choice

A VIF (Variance Inflation Factor) of 15 indicates:

Explanation: VIF > 10 indicates severe multicollinearity. VIF = 15 means that predictor's variance is inflated 15× due to correlation with other predictors, making its coefficient unreliable.
Q5 multiple-choice

In a model predicting salary from education and experience, the coefficient for education is significant (p = 0.02). This means:

Explanation: A significant coefficient means that predictor has a statistically significant association with the outcome AFTER controlling for other variables. It doesn't prove causation.
Q6 multiple-choice

What is the general rule for sample size in multiple regression?

Explanation: A common rule of thumb is 15-20 observations per predictor. Too few observations per predictor leads to overfitting and unstable estimates.
Q7 multiple-choice

Simple regression of Y on X₁ gives b₁ = 5.0. Multiple regression of Y on X₁ and X₂ gives b₁ = 2.0. What likely happened?

Explanation: When a coefficient drops substantially after adding another variable, that variable was likely a confounder. Some of X₁'s apparent effect was actually due to its correlation with X₂.
Q8 multiple-choice

Which is NOT a symptom of multicollinearity?

Explanation: Curved residual patterns indicate non-linearity, not multicollinearity. Multicollinearity symptoms are: inflated SEs, good model fit but non-significant predictors, unstable coefficients.
Q9 multiple-choice

AIC and BIC are used for:

Explanation: AIC (Akaike Information Criterion) and BIC (Bayesian Information Criterion) are used to compare models and select the best one, balancing fit with parsimony. Lower values are better.
Q10 multiple-choice

In stepwise regression, what is the main concern?

Explanation: Stepwise methods can capitalize on random variation in the sample, selecting variables that appear significant by chance. The resulting model may not replicate in new data (overfitting).

Quiz Results

0 %

← Simple Regression Next: Model Comparison →