yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Calculating residual example | Exploring bivariate numerical data | AP Statistics | Khan Academy


3m read
·Nov 11, 2024

VI rents bicycles to tourists. She recorded the height in centimeters of each customer and the frame size in centimeters of the bicycle that customer rented. After plotting her results, she noticed that the relationship between the two variables was fairly linear. So she used the data to calculate the following least squares regression equation for predicting bicycle frame size from the height of the customer.

And this is the equation. So before even looking at this question, let's just think about what she did. She had a bunch of customers and she recorded, given the height of the customer, what size frame that person rented.

So she might have had something like this, where in the horizontal axis, you have height measured in centimeters, and in the vertical axis, you have frame size that's also measured in centimeters. There might have been someone who measures 100 cm in height who gets a 25 cm frame. I don't know if that's reasonable or not for you bicycle experts, but let's just go with it.

And so she would have plotted it there. Maybe there was another person of 100 cm in height who got a frame that was slightly larger, and she plotted it there. Then she did a least squares regression. A least squares regression is trying to fit a line to this data. Oftentimes you would use a spreadsheet or use a computer, and that line is trying to minimize the square of the distance between these points.

The least squares regression, maybe it would look something like this. This is just a rough estimate of it. It might look something, let me get my ruler tool, it might look something like this. So let me plot it. So that would be the line. Our regression line, Y hat, is equal to 1/3 + 13x.

You could view this as a way of predicting or either modeling the relationship or predicting that, hey, if I get a new person, I could take their height, input it as an X, and figure out what frame size they're likely to rent. But they ask us, what is the residual of a customer with a height of 155 cm who rents a bike with a 51 cm frame?

So how do we think about this? Well, the residual is going to be the difference between what they actually produced and what the line, what our regression line would have predicted. So we could say residual, let me write it this way: the residual is going to be actual minus predicted.

If predicted is larger than actual, this is actually going to be a negative number. If predicted is smaller than actual, there's going to be a positive number. Well, we know the actual; they tell us that. They tell us that the 155 cm person rents a bike with a 51 cm frame. So this is 51 cm.

But what is the predicted? Well, that's where we can use our regression equation that VI came up with. The predicted, I'll do that in orange, the predicted is going to be equal to 1/3 + 1/3 * their height. Their height is 155. That's the predicted Y hat, that's what our linear regression predicts.

So what is this going to be? This is going to be equal to 1/3 + 155 over 3, which is equal to 156 over 3, which comes out nicely to 52. So the predicted on our line is 52.

So here, this person is 155. We can plot them right over here, 155. They're coming in slightly below the line. So they're coming in slightly below the line right there, and that distance, which we can see that they are below the line, means the residual is going to be negative.

So this is going to be negative 1. If we were to zoom in right over here, you can't see it that well, but let me draw. So if we zoom in, let's say we were to zoom in on the line, and it looks like this, and our data point is right over here. We know we're below the line, and it's just going to be a negative residual.

The magnitude of that residual is how far we are below the line, and in this case, it is -1. That is our residual—this is what actual data minus what was predicted by our regression line.

More Articles

View All
These Twins Show That Race Is A Social Construct | National Geographic
My name is Marcia and I’m 11 years old. My name is Mary and I’m 11 years old. When they see us together, some don’t believe that we’re twins. They don’t believe us; they’re like, “Oh really? I never noticed that. I thought you were just friends,” because …
Saving Cabins in the Arctic | Life Below Zero
I’m learning new country this winter, so my greatest challenge is don’t let the land or the weather kill me. The water is cold; you feel get used to it after a while. This is a big chunk of ice. Rico and Skyler have traveled to the Celawat hot springs wit…
Introduction to limits at infinity | Limits and continuity | AP Calculus AB | Khan Academy
We now have a lot of experience taking limits of a function. So if I’m taking the limit of f of x, we’re going to think about what does f of x approach as x approaches some value a. This would be equal to some limit. Now, everything we’ve done up till no…
Sal interviews the AP Calculus Lead at College Board | AP Calculus AB | Khan Academy
So this is Sal Khan, founder of the Khan Academy, and this is a very exciting Skype call that we’re on. I’m with Ben Hedrick, who’s the lead for AP Calculus. What do you do at the College Board? Uh, really anything with AP Calculus and AP Statistics is s…
A warning about Robinhood's 3% Checking Account…
What’s up you guys, it’s Graham here. So I’ll just get right into it. CNBC just recently published an article saying that Robinhood, the stock trading platform, is now going to be offering checking and savings accounts. My initial reaction to this was gre…
We Tracked Every Visitor to Epstein Island | WIRED
Even in death, the secrets of Jeffrey Epstein remain tightly guarded. But earlier this year, I spearheaded a Wired investigation that uncovered the data of almost 200 mobile phones belonging to visitors to his infamous pedophile island. The data was so pr…