Estimating and Interpreting Regression Coefficients
How least squares estimates regression coefficients and how to interpret numerical and categorical predictors in fitted models.
How least squares fits a model
How least squares fits a model
For each observed pair , a fitted line predicts . The is the difference between the observed and predicted responses:
A records how far the model’s prediction is from an observation. Least squares chooses the and to minimize the sum of the squared residuals:
Squaring makes the objective depend on the size of each prediction error rather than allowing positive and negative residuals to cancel. In multiple regression, the same principle applies: choose coefficients that minimize the sum of squared residuals across observations.
For simple linear regression, the minimizing coefficients are
The formula requires variation in the observed predictor values. If every is the same, then , so the formula cannot be used. When it is defined, these estimates make the fitted line pass through : at , the fitted value is .
Reading intercepts and slopes
Reading intercepts and slopes
In a fitted line , the is the model’s predicted response at . The is the predicted response change for a one-unit increase in . A positive indicates an increasing fitted relationship; a negative one indicates a decreasing fitted relationship. The ’s units are response units per predictor unit, while the has the response’s units.
Consider the model predicting weekly earnings in dollars from hours worked:
The means the model predicts $18 more in weekly earnings for each additional hour worked. The predicts $120 at zero hours. That prediction may or may not be practically meaningful: zero hours could be outside the observed data or not a useful reference point. The describes an estimated association; by itself, it does not establish that working an extra hour causes earnings to increase by $18.
In multiple regression, the is the predicted response when all included predictors are zero. A coefficient for one predictor describes the estimated response change for a one-unit increase in that predictor while holding the other included predictors constant. As with a simple-regression , the prediction at zero-valued predictors may have little practical meaning if those values are impossible, outside the data, or not meaningful in context.
Comparing categories with indicator variables
Comparing categories with indicator variables
A categorical predictor can be represented with indicator variables. For a two-category predictor, code the as and the comparison group as . In the model
substituting each code shows what the coefficients mean:
: , so .
Comparison group: , so .
At the same value of , the comparison group’s prediction is therefore higher or lower than the ’s prediction, depending on the sign of . The ’s is ; the comparison group’s is . Both groups have the same for in this model.
If the relationship between and the response may differ by group, an can be added. In , for example, the has , while the comparison group has . This gives the model a way to represent different slopes rather than requiring them to be equal.
For a categorical predictor with more than two categories, use one fewer indicator than the number of categories and leave one category as the reference. Each indicator coefficient represents a predicted difference from that reference, conditional on the other predictors in the model. Because the comparison is defined by the coding, changing the reference category changes how the coefficients are interpreted.
: The sum of squared residuals, which least squares seeks to minimize.
: A variable coded 0 or 1 to represent membership in a category.