Learn

Let’s again inspect the output for a regression that predicts weight based on height. The regression line looks something like this:

plot of height vs. weight with a regression line drawn through the points

Note that the units of the intercept and slope of a regression line match the units of the original variables; the intercept of this line is measured in kg, and the slope is measured in kg/cm. To make sense of the intercept (which we calculated previously as -21.67 kg), let’s zoom out on this plot:

plot of height vs. weight with a regression line drawn through the points, zoomed out so that we can see where the line crosses the y-axis (a vertical line at x=0)

We see that the intercept is the predicted value of the outcome variable (weight) when the predictor variable (height) is equal to zero. In this case, the interpretation of the intercept is that a person who is 0 cm tall is expected to weigh -21 kg. This is pretty non-sensical because it’s impossible for someone to be 0 cm tall!

However, in other cases, this value does make sense and is useful to interpret. For example, if we were predicting ice cream sales based on temperature, the intercept would be the expected sales when the temperature is 0 degrees.

To visualize the slope, let’s zoom in on our plot:

plot of height vs. weight with a regression line drawn through the points, zoomed in so that we can see that each horizontal increase of height by 1cm is associated with a 0.5 kg increase in height.

Remember that slope can be thought of as rise/run — the ratio between the vertical and horizontal distances between any two points on the line. Therefore, the slope (which we previously calculated to be 0.50 kg/cm) is the expected difference in the outcome variable (weight) for a one unit difference in the predictor variable (height). In other words, we expect that a one centimeter difference in height is associated with .5 additional kilograms of weight.

Note that the slope gives us two pieces of information: the magnitude AND the direction of the relationship between the x and y variables. For example, suppose we had instead fit a regression of weight with minutes of exercise per day as a predictor — and calculated a slope of -.1. We would interpret this to mean that people who exercise for one additional minute per day are expected to weigh 0.1 kg LESS.

Instructions

1.

Checkpoint: The intercept for the OLS regression model predicting score based on hours_studied is 43. In interpretations.txt give a one-sentence interpretation of the intercept for this model. Does this intercept make sense in real life?

Click Run after you’ve written your interpretation.

2.

The slope for the OLS regression model predicting score based on hours_studied is 9.8. In interpretations.txt give a one-sentence interpretation of the intercept for this model.

Click Run after you’ve written your interpretation.

Take this course for free

Mini Info Outline Icon
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Or sign up using:

Already have an account?