4.9 Multiple linear regression
So far, we have been working with one dependent variable and one independent variable. Nevertheless, it is not unusual to have several independent variables that we want to include in our model. Some examples could be:
Perceived quality of wine (dependent) and acidity, density, alcohol level, residual sugar, and sulfates content (independent variables)
A student’s average grades (dependent) and family income, distance from home to school, and mother’s education level (categorical variable)
We can easily extend the simple linear regression model to deal with more than one independent variable. We call this model multiple linear regression or, less often, multivariable linear regression (not to be confused with multivariate linear regression, the case where we have multiple dependent variables).
In a multiple linear regression model, we model the mean of the dependent variable as follows:
Using linear algebra notation, we can write a shorter...