NeuroNomixer logoNeuroNomixer
  • Home
  • Blog
  • Visual Guides
  • Authors
  • Contact
Sign InSign Up
NeuroNomixer logo
HomeBlogAuthorsContactPrivacy Policy

© 2026 NeuroNomixer — Built with Next.js & Tailwind CSS

Visual Guides/Multiple Regression & Confounding
UNIT 10: REGRESSION FOUNDATIONS

Multiple Regression & Confounding

Add predictors and watch coefficient estimates shift. Understand why controlling for confounders reveals true effects.

Simple model viewed
Multiple model viewed
Coefficients interpreted
Interaction explored
Confounding identified

Sign in to track progress

The Dataset

Daily ice cream sales at a beach café (50 observations). Two predictors: Temperature (°C) and whether the day is a Weekend. Goal: understand how each factor drives sales, accounting for the other.

Observations50 days
Temp range15 – 35 °C
Weekend days16 / 50
Sales range$20k – $90k

Scatter Plot: Ice Cream Sales vs Temperature

15°18°21°24°27°30°33°20304050607080Temperature (°C)Sales ($k)
Weekday
Weekend
OLS line (temp only)

Hover over any point to see its values.

Simple Regression Equation

Sales = -30.13 + 3.33 × Temp

R²

0.9516

RMSE

4.16

Temperature coefficient: 3.331

For every +1°C increase in temperature, sales increase by $3.33k (according to this simple model).

Note

This model ignores whether it's a weekend. In this dataset, weekend days are both hotter AND more sales-prone, so the temperature slope absorbs part of the weekend effect and comes out inflated.

Key Concepts

Confounding Variable

A variable correlated with both the predictor and outcome, creating spurious associations.

Omitted Variable Bias

Excluding a relevant predictor causes its effect to leak into other coefficients.

Parallel Lines

In an additive model, lines for different groups are parallel: same slope, different intercept.

Interaction Effect

When the effect of X₁ on Y changes depending on the value of X₂.

Adjusted R²

Penalizes adding predictors that don't meaningfully improve fit.

R² Comparison

Simple0.9516
+ Weekend0.9913
+ Interaction0.9914

Coefficient Comparison Table

Temperature coefficient shifts across models: confounding effect!
CoefficientSimple+ Weekend+ Interaction
Intercept-30.125-20.793-21.290
Temperature3.3312.8352.857
Weekend—9.99313.367
Temp × Weekend——-0.117
R²0.95160.99130.9914
Adj. R²—0.99090.9908

Temperature coefficient highlighted: compare values across models to see confounding effect.

← Simple Linear RegressionRegression Diagnostics →