Interpreting Slope and Intercept

1. Interpreting Slope and Intercept

We've seen how linear models are built from zeroth and first order "terms" or "components", but what about the coefficients of those terms, or put another way, the "parameters" of the model? In this lesson, you will interpret the model parameters, intercept and slope, in specific contexts, to see what they can tell us about the linear relationship being modeled.

2. Reminder: Terminology

Let's review the parts of a linear model before using them. The model is `y = a0 + a1*x`. For a given `x` and model parameters `a0` and `a1`, we compute a prediction for the value of `y` as `a0 + a1*x`. `x` is an independent variable, like time, which changes on it's own. `y` is a dependent variable, which changes in response to changing `x`, like distance traveled. A model prediction is the result of using a specific value like `x=10`, with the model, to compute a specific value for `y`

3. Intercept

The a0 parameter in `y = a0 + a1*x` is called the "intercept" because it gives the value of `y` where the line intercepts the vertical line at `x=0`. For example, a hiker at the start of a trail has traveled x=zero step distance, but starts at an altitude of y=100 feet. 100 feet is the intercept.

4. Slope

The `a1` parameter in `y = a0 + a1*x` is called the "slope". Slope is a measure of how sensitive a dependence exists between the two variables x and y. Or put another way, how two variables co-vary: the slope gives the average amount by which the dependent variable changes when the independent variable changes. Continuing with the hiking example, if the hiker travels x = 5 kilometers along the trail, the altitude increases from 100 to 225. The slope is the change in altitude, 225-100, divided by the change in step distance, 5 - 0, so together, slope = 125/5 = 25.

5. Average Slope

Once the hiker reaches the trail end, the altitude is 350 meters and the distance hiked is 10 kilometers. The final slope is also 25. Here we've computed slope from a linear model. If computed from real data that has variation, the slope values will vary along the trail. This variation in slope translates into "spread" or "uncertainty" in our value for `a1`.

6. Rescaling versus Dependency

Sometimes two things are **defined** as having a linear relationship for the convenience of "rescaling the ruler". This is the idea behind unit conversion. It's a case that causes confusion, so we'll take a look at it here to clear things up. A common example is the relationship between the Celsius and Fahrenheit temperature scales. This is a special case wherein BOTH dimensions, what normally we'd call the "independent" and "dependent" variables, are measuring exactly the same thing. They are just different ways of measuring a single physical variable: the temperature. But it's worth looking at this case to clarify and to be mindful that sometimes, things are not so clear as to which variable is "dependent or independent".

7. Let's practice!

Now that you have seen visual and code examples of the linear model parameters, slope and intercept, let's practice building a few models with a focus on the interpretation of these two parameters in context. In later lessons, we'll focus more on model predictions.