a. The Linear Model
Math 115
So far, our explanatory variables have always been categorical — they sorted observations into groups:
Today both variables are numerical — height (cm) and weight (kg). No groups to compare, and two new questions open up:
A scatterplot plots each observation as a point in the (x, y) plane.
Data: body measurements from 507 physically active adults (Heinz et al., 2003; bdims in openintro).
Each point is a single case — here, one person.
Height and weight show a clear positive association.
The cloud of points sits roughly along a straight line. The line of best fit summarizes the trend.
For these data, the blue line is
\widehat{wgt} = -105 + 1.02 \times hgt
That one equation lets us describe the trend and predict y from x. How the “best” line is chosen (least squares) is for 17b. Today: how to read the line.
Our fitted line
\widehat{wgt} = -105 + 1.02 \times hgt
is one instance of a general form:
\hat{y} = b_0 + b_1 \, x
Try it — why write \hat{y} rather than plain y?
y is the weight a person in the data actually has. \hat{y} is the weight the line predicts at that height. For almost everyone the two differ.
b_0 and b_1 are computed from the sample — they’re statistics.
Every statistic we’ve met has a population counterpart:
| Sample statistic | Population parameter |
|---|---|
| \hat{p} | p |
| \bar{x} | \mu |
| b_0, b_1 | \beta_0, \beta_1 |
\beta_0 and \beta_1 are the true intercept and slope we’d get if we could see the whole population. We’ll do inference on \beta_1 in topic 18.
| Role | Symbol | Other names | Example |
|---|---|---|---|
| Response | y | outcome, dependent | weight |
| Predictor | x | explanatory, independent | height |
The response is what we’re trying to predict; the predictor is what we use to predict.
Plug a value of x into \hat{y} = -105 + 1.02 \, x:
Predict weight for someone who is 170 cm tall:
\widehat{wgt} = -105 + 1.02 \times 170 = 68.4 \text{ kg}
Now you: predict weight for someone who is 180 cm tall.
\widehat{wgt} = -105 + 1.02 \times 180 = 78.6 kg
The 10 cm difference in x produced a 10.2 kg difference in \hat{y} — that’s the slope times 10, by design.
Template (memorize this):
For each additional [unit of x], we expect [y] to [increase / decrease] by [|b_1|] [units of y], on average.
Try it — fill in the template for our model (b_1 = 1.02):
For each additional centimeter of height, we expect weight to increase by 1.02 kg, on average.
Two cautions:
Intercept (b_0 = -105):
The predicted weight for someone whose height is 0 cm is about -105 kg.
That’s not a meaningful person. A 0 cm height is nonsensical, and the model predicts negative weight there. So the intercept here is not interpretable as a prediction — it’s mostly a positioning parameter: it sets the line’s vertical placement so it passes through the data cloud at realistic heights.
Intercept is interpretable only when x = 0 is meaningful — for example, if x were “hours studied,” b_0 would be the predicted score with no studying.
Extrapolating — predicting outside the range of observed x — can be misleading.
Rule of thumb: only trust predictions within (or very near) the range of observed x values.
Nutrition facts for 77 Starbucks food items — carbohydrates (g) predicting calories.
\widehat{calories} = 146 + 4.3 \times carb
Predict the calories for an item with 40 g of carbohydrate. 146 + 4.3 \times 40 = 318 calories.
Interpret the slope in context. For each additional gram of carbohydrate, we expect calories to increase by about 4.3, on average.
We’ve built the linear model and learned to read it — slope, intercept, predictions, and the limits of extrapolation.
Next time (17b): how the line is actually chosen (least squares), how to measure how strong the linear relationship is (the correlation coefficient r and R^2), and how to check whether a line is even the right tool (residual plots).
bdims in openintro.)