Multiple Regression — Beyond Two Variables
Visualize a 3D regression plane for two predictors and see how it scales to three, four, or more variables. Learn what partial slope coefficients actually mean.
Multiple Regression
With two or more explanatory variables, it's multiple regression.
Predict y (e.g., test score) from x₁ (study hours) and x₂ (sleep hours), handling several factors at once.
Instead of a regression line, you get a regression plane. β₁ is the effect on y of a unit change in x₁ holding x₂ fixed; β₂ is the same for x₂.
Set true parameters, generate data, and compare the estimates to the truth.
Drag the canvas to rotate and see the plane and data in 3D.
Note: only 2 predictors can be drawn (our eyes top out at 3-D).
But the equation keeps going — ŷ = β₀ + β₁x₁ + β₂x₂ + β₃x₃ + … + βkxk — you can add as many variables as you like.
From x₃ onward you just "can't draw it", but the estimator β̂ = (XᵀX)⁻¹Xᵀy works exactly the same.
In practice, 5–50 predictors is very normal.