Lesson 3.2 · 8 min read · about 55 min to master at a very slow pace

Simple and Multiple Linear Regression

One predictor or many, the model is a weighted sum of inputs. Why a model with X² or interaction terms is still "linear" regression: it only has to be linear in the coefficients.

Not startedJump to quiz

Simple linear regression

One predictor:

is the intercept (the predicted when ) and the slope (the change in predicted per one-unit increase in ). The fitted model is a straight line.

Multiple linear regression

Several predictors:

With two predictors the fitted model is a plane in 3-D space; with more it is a hyperplane. The algebra is identical, it just can't be drawn. It's a parametric model: a finite list of coefficients.

"Linear" means linear in the coefficients

This surprises almost everyone. The model below is still linear regression:

The curve is a parabola, but the unknowns each appear on their own, multiplied by a known number and added up. Create a new column and it becomes an ordinary multiple regression with two predictors. The same fitting method (OLS) works unchanged.

02.557.5100246810xy
ŷ = 8.9 − 2.6x + 0.26x² (linear in β)
A curved fit from linear regression: the predictors are x and x², and the model is a weighted sum of them.

Interactions are linear too

is just another column computed from the data. The interaction lets the effect of depend on : the slope for is .

ModelLinear regression?Why
YesEach multiplies a known column
Yes is a known column
Yes is a known column
No sits inside an exponential
No is an exponent

Test

Treat the data as fixed numbers. If the model is a sum of (coefficient × something computed from the data), it is linear regression, however curved the picture.

Stuck? Common doubts

Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.

First passWhy is still called linear regression when is squared?

Because "linear" refers to the coefficients, not the inputs. is computed from the data, so it's a known number for every row. The model is : each unknown multiplies a known value, and the terms are added. Treat as a second predictor column and it's an ordinary multiple regression.

First passWhy is a model with an interaction term still linear regression?

Same reason: is a column you can compute from the data before fitting. The model is still a weighted sum with unknown weights , so OLS fits it exactly as before.

First passWhat does "linear in the coefficients" mean?

The unknown parameters appear only to the first power, each multiplied by something known, and the pieces are added. The inputs themselves can be transformed in any way (squared, logged, multiplied together). A model like is not linear in its coefficients, because is inside the exponential.

Cheatsheet

Multiple linear regression

; prediction .

"Linear" regression

Linear in the coefficients, not the inputs. , , are allowed.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1conceptIs a linear regression model?
Q2conceptWhich of these models is NOT a linear regression model?
Q3interpretIn , what is the effect of a one-unit increase in ?
Q4conceptA multiple regression with two predictors fits what shape in space?
Q5applyA scatter plot shows a clearly curved relationship between and . What's the simplest fix that stays within linear regression?