Adding Multiple Predictors
Explore how to build and interpret multiple linear regression models using numeric and categorical predictors. Learn one-hot encoding for categories, interpret coefficients conditionally, and detect predictor overlap like multicollinearity. This lesson helps you understand building stable models and explaining predictions effectively.
We'll cover the following...
A used-car price depends on more than one number. A 2019 sedan with 80_000 miles and a premium trim may cost more than a 2016 sedan with 80_000 miles and a basic trim. Mileage alone cannot separate those cases, so the prediction needs mileage, age, and trim together.
Multiple regression extends linear regression by using several feature columns to predict one numeric target. The model still combines an intercept and coefficients, but each coefficient belongs to one predictor.
The interpretation changes when we add predictors. A mileage coefficient no longer means the overall relationship between mileage and price. It means the model’s predicted price change for mileage while age and trim remain fixed. This condition is called holding other variables constant.
For example, if the mileage coefficient is -0.08, then an additional 10_000 miles changes the predicted price by:
That statement compares cars with the same age and trim. Without that condition, older cars might also have higher mileage, and the coefficient would mix both relationships.
Fit the full car-price model
A realistic feature table contains numeric columns such as mileage and ...