Common Core Algebra I.Unit 10.Lesson 10.Residuals
Algebra 1
Hello and welcome to another E math instruction common core algebra one lesson. My name is Kirk weiler and today we're going to be doing unit ten lesson number ten on residuals. Let me remind you that you can get a copy of the worksheet that we use in this lesson, as well as a copy of a homework that goes along with it by clicking on the video's description or by visiting our website at WWW dot E math instruction dot com. As well, don't forget that we have these great QR codes at the top of every worksheet that allow you to take any mobile device with a QR reader scan them and take it right to this video. So let's get into what a residual is. In previous lessons, we've been working with lines of best fit and exponential equations of best fit, quadratic equations of best fit. And we've even looked at what's known as the correlation coefficient, also known as the R value. The R value has helped us think about how good a model is at predicting what the data is doing. In both of these scatter plots, a line of best fit has been drawn. And in both cases, there is a fairly strong positive correlation between the input data and the output data. I would even estimate without doing any kind of formal calculation that the R value for both of these two graphs is somewhere on the order of .9 2.95. So fairly strong, fairly strong. But a model, a regression model can actually have quite good predictability, but not necessarily be appropriate for what we're trying to do. All right? And that's what we're going to look at today. What are known as residuals and residual plots can help us determine at least in a very sort of informal way. Whether or not we've picked the correct type of model, IE did a linear do a good job, or should we picked an exponential or quadratic instead, right? So I'm going to clear out this text, and we're going to jump into the first problem. Okay, let's take a look. A skydiver jumps from an airplane and an attached microcomputer records the time and speed of the diver. For the first 12 seconds of the divers freefall, the data is shown in the table below. So this is a good example of where, you know, there were definitely be some noise introduced in the data due to just simply, you know, the recording devices, the fact that we're falling out of an airplane, et cetera. So the first thing that the problem asks us to do is find the equation of the line of best fit for the dataset, round both coefficients to the nearest tenth. So we're going to do line of best fit, not exponential or quadratic. As well, we're going to determine the correlation coefficient. We're going to round that to the nearest hundredth. As well as the parameters to the nearest tenth. Based on the correlation coefficient, we're going to characterize the fit as positive or negative and how strong the fit is. Then we're going to create a plot, a scatter plot that is, with both the data and the line of shown on it, maybe we'll do a little sketch of the plot, but we really just want to see it on our calculator to get a sense for what's going on. Now, we've done this in a previous lesson. So what I'd like you to do is pause the video now, enter that data into your calculator, do everything the problems asking for, and then we'll walk through it on our own calculator, okay? All right, let's go through the procedure. Now again, I'm going to be using a TI 84 plus, so let me bring that up now. Excellent. I'm going to have to cover up a little bit of the screen, so I apologize for that. Let's get into the data. And let's start to enter it. Remember how we do that? We hit the stab button. All right, we go into edit. If there's any kind of information in either our lists, we clear it out. We go up to the clear, we go up and highlight list. We hit clear, and that's going to get rid of all the data. All right? So let's put the input data into L one, so R zero, R two, four, 6, 8, ten, and 12, okay, we have to make sure we enter our data correctly. Then in L two, we're going to put in our output data. In this case, our speed, zero, 25, 46, 60, 68, 72, and 74 once I'm done entering data, I always make sure it's correct. I always look over it at least once or twice because any kind of mistaken data entry is going to obviously throw my answers off. So check the data. Okay. Now, let's hit our stat button again. Let's go over to the calculate menu now. And let's go down to linear regression. Okay, on my calculator, that's option four, so we go down. We hit enter. And we get all of our information. Now hopefully you're used to reading this at this point, but what we can see now, right? Is that our slope a is 6.03 5, et cetera. So rounded to the nearest tenth, that's just going to be 6.0. I know that's a little confusing. Our Y intercept is 13.07, et cetera. So rounded to the nearest tenth, 13.1. Which means our model is Y equals 6.0 X plus 13.1, okay? So there's our model. All right, our R value is just kind of sitting there. So that's point 9 three 5, et cetera. So rounded to the nearest hundredth .94. Now what you say, what you think about how strong of a fit is, whether it was positive or negative. And our value that's that close to one would consider be considered, I would say a strong, not a perfect, but a strong positive correlation. Or a strong positive fit, right? We would say that the model has got good predictability or good predictive power. You know, what that means is that if I take any of those times and I put them into my model, it will give me a pretty good sense for what my speed should be. All right? That's what it means for it to be a strong positive fit or really just for it to be a strong fit. Now what I want to do is I just want to see how that line looks in terms of scatter plot. So let's remember how we do our scatter plots since we have the calculator open. We're going to go into stat plot. That's above Y equals. So let's go into stat plot. Okay. We want to highlight the scatter plot. If it's not already highlighted, then what we're going to do is for our X list, we're going to put in L one, all right? And for our wireless, we're going to put in L two. If you're not sure where L one and L two are, they're above the one and the two buttons on the numeric keyboard, right? So you can get them there. All right, we're all set. Now what we also want to do is make sure that we have our line of best fit in Y equals. So let's go into Y equals. Let's clear out anything that might be there. And let's put Y one equals 6.0 X plus 13.1. Now we can definitely set a good window based on the data that's sitting in front of us, or we could use a nice zoom option that's on our calculator called zoom stat. Let's take a look at that really quick. I think that's a nice one to look at. So let's hit zoom. Let's find zoom stat. Let's go down a little ways. There it is. Zoom stat. And now I'm going to hit enter. And there we are. And we can see why we've got a pretty good fit, right? I mean, the data is definitely increasing the outputs are definitely increasing as the inputs increase. So that's the positive fit. And the line does a decent job. Although you can definitely tell that it misses quite a few of the data values. All right? What we're going to look at next is how we can use the idea of a residual to tell that the linear model really isn't the best fit here. Okay? So I'm going to clear out this screen and we're going to go on to the next screen and take a look at what residuals are. Let's say goodbye to the calculator for right now. All right, and clear out the and clear out the screen. Okay, let's take a look at what a residual is, given that it is the topic of the lesson. All right, the residual of a data point. So we're going to divide to find a residual for every single data point we have. The residual of a data point is defined as the difference, the difference, the subtraction between the observed Y value. That's the one that we actually saw. And the predicted Y value. That's the one we could calculate using our equation. In fact, let me write our equation down. Y equals 6.0 X plus 13.1. All right? Let me show you how this works exactly. All right, so for the first time, a time of zero, we have an observed, right? These are the observed values here. All right, we have an observed value of zero. But what's our predicted value? Well, when X is zero, our predicted value is Y equals 6.0 times zero plus 13.1. So our observed values 13.1. Wow, that's quite a big difference, isn't it? Now, the residual will be the difference between the observed value zero minus the predicted value 13.1. This is a little bit of an odd one because the residual is negative 13.1. Residuals can be either positive or negative. When a residual is negative, what it means is that the prediction is much larger than the actual observed. All right? And when residual is positive, it's going to work the other way around. But we'll see one of those in a second. Let's take a look at the second one. All right, for the second data point, what we have is we have X equals two. In that case, the predicted value is going to be 6.0 times two plus 13.1. And that is going to be 25.1. Well, that's a lot closer, right? Take a look at how much closer the now observed value is versus the predicted. Still, though, what we're going to do is take our observed value 25, subtract our predicted value, 25.1, and we get a much smaller residual. The size of the residual you can almost think of as the error in the model, right? How much is the model off in terms of predicting the output? Okay? Let's do one more and then we'll kind of have you fill in the rest when I have X equals four. Our predicted value is going to be 6.0 times four plus 13.1, just kind of cranking through that. That's 37.1. Right. So the residual now is going to be the observed value 46 minus the predicted value, 37.1, and now we finally have a positive. A positive 8.9. All right. So let's take a look at some of the really quick, right? Our residual is going to be negative. Any time the prediction is greater than the observed or likewise, any time the observed is less than the predicted. On the other hand, the residual will be positive anytime the observed value is greater than the predicted value. So what I'd like you to do is pause the video and see if you can fill in the rest of that table, okay? All right, so I'm not going to show you the calculation for the rest of the predictions. All you have to do is continue to put the input values into our model, our 6.0 X plus 13.1, what we'll get for our predicted values are 49.1. 61.1. 73.1. Sorry about the all the point ones. 85.1. That's because of that 13.1 on the Y intercept. Now, if we keep doing the subtraction, the observed minus the predicted will get the following. 10.9, then 6.9, then negative 1.1. And negative 11.1. So the calculation of a residual is actually relatively easy. It's just a formula, right? It's going to be the difference or the subtraction of the observed value minus the predicted value. Okay? So so far, that doesn't tell you much. It does give you kind of an error. It kind of when you look at that table, you can tell that the model did a very, very good job predicting the outputs when the inputs were ten and two. Look at how small the residuals are in that case. But didn't do such a great job there in the middle or on the ends. So I'm going to clear this out, make sure to really think about what we just did, copy it down. Here it goes. All right, now let's see how to use the calculator to crank out some residuals, all right? All right. C says sketch a plot of the residuals below. Your teacher will need to show you how to do this on your graph and calculator. Okay, so let me show you how to do this. This is a little bit complicated. So I think it's got a nice that you can come back to this video time and again if you need to remember how to hit the right order of buttons. So luckily, our calculator was almost everything in it right now that it needs in order to produce the residual plot. So here's what we're going to do. We're going to actually go back into the stat plot. So we got to bring up our TI 84 plus right now. All right, now that we have it open. Let's go into our stat plot by going into that thing above the Y equals. Okay, let's go back into plot one. Okay, I know this was a scatter plot before. We're going to leave our X list as L one. That's still going to be the case. In our Y list, though, what we need is we need to get our residual values in there. See, what you do is you plot the residual versus the input. That's what you have. So the X values versus the residuals. All right. Now where do we get the residuals? That's what's a little bit tricky here. So what we're going to do is we're going to hit the stat button or we're not going to hit the stat button. I'm sorry. We're going to go to the stat button and right above it is this little word list, all right? So you're going to hit second stat, okay? And notice it has all the lists L one L two L three. And at the bottom, it says residue. So we're going to go down and we're going to grab residual. All right, now look at that. So in our X list, we have L one and our Y list, we have residual. Okay. So we're basically ready. Now, I like to turn off any equations that I might have right now. Because I don't really want them plotted at the same time as the residuals. It really doesn't make a lot of sense. So what I'm going to do is I'm going to go into Y equals. And I'm going to either clear out that line of best fit. I think I'm going to just do that. Or you could just turn it off by un highlighting the equal side if that makes sense. Regardless, we don't want that on. Now what we can do again is hit zoom stat. All right, so let's go back into Zoom. And let's go down to zoom stat and let's hit enter. And take a look at that. That's what's known as a residual plot. All right? What I'm going to do is I'm going to do a little sketch of it right over here. And it looks a little bit like this, right? I'm not going to get the perfect sketch. Now. What a statistician will tell you is that that is a terrible looking residual plot. All right? And the reason a statistician would tell you that is because it forms a pattern. It's got a curve to it. There's a distinct pattern to it. Strangely enough, the best residual plots are ones that are completely chaotic. They're just, they're all over the board. This one, though, kind of has a disturbing pattern. Now, we don't want that. And in fact, when we have a pattern, what that means is that our model is not good. Ma'am. He's going to say not equals model not good. But a pattern really tells us that the model is not good. And I'll give you a little bit of an explanation on that in just a second, okay? But for right now, I just wanted to really walk you through how to find those. All right, and how to do the residual plot. So if you see a pattern, if the residuals are falling along kind of a predictable curve, and that tells you that the model might have good predictability, but isn't applicable, right? It's not an appropriate model. Maybe something else maybe a quadratic of best fit and exponential of best fit, or some other type of curve that we've never seen before. Anyway, I'm going to clear this out. And we're also going to say goodbye to the calculator. All right. So let's talk about why this makes some sense. Bringing back those, bringing back those two scatter plots we had before. All right? One nice way of visualizing residuals. I'm already in red. Is by connecting the data points to the line of best fit with little vertical lines. All right? Those were actually this one's right there. Those vertical lines really give you the residuals. Remember, the residual is the observed value minus the predicted value. So anytime a data point lies below the line of best fit, the residual is negative. I can actually kind of plot the residuals here. At any time the line of any time the data is above the line of best fit, the residuals are positive. So my residuals in this graph that I'm looking at here would look something like this. All right. Notice how they're scattered above and below the X axis in a very sort of random way. On the other hand, the residuals here, right here, I'd have a positive here I'd have one that was right on the axis. Here though I'd have a negative. Here it might even be a little bit more negative. And even here, more negative, maybe here a little bit less negative. And even a little bit less negative, then I'm back to zero. And then I've got one that's a little bit positive. And one that's even more positive. Notice how those end up going along a curve. What that really means is that it would have been much better for me to fit this with let's say an exponential or a quadratic of best fit. Even though the R value might have been perfectly good with a linear fit on this dataset, the residuals show too much of a pattern, right? It means that the linear is over predicting an under predicting in a way that's not random in a way that's very systematic, all right? That's why we want we want this. This is a good a good residual plot. This is a bad residual plot, all right? It's one that tells us that we really should choose a different model. And that's tricky for people. But it's good because in combination with the R value, we can talk about not only how well the model does predicting the outputs. But whether or not it's the correct model in the first place. I'm going to clear out all this beautiful writing. So write down anything you need to. All right, here we go. Let's do another problem. All right, exercise to a school district was attempting to correlate the number of hours of student studies in a given week to their grade point average. They surveyed 8 students and found the following data. All right, so the hour studying our inputs and the GPA is the output. Letter a, find the equation for the line of best fit and the associated R value. Around the linear correlation coefficient to the nearest tenth, the R value to the nearest hundred, then create a scatter plot, both the data and the line graph, et cetera, et cetera. So why don't you pause the video? Go ahead and do that. See what you get. And then we'll walk through it. All right, why don't we go through it? Let's bring up that TI 84 plus again. Hello TI 84 plus. Okay, this will give us a good chance to take a look at how to clear out data properly. So let's go into stat. Let's go into edit, go up to L one. Let's clear out the data. Go over to L two, clear out the data. All right? Let's put the data in. Three. Two, 11, 8, 16, 5, and 9. All right, always good to check your data and make sure that it's correct. Let's go and put the output data into L two. 78. 80. 25. 94, 89, 92. Sorry, this takes a little while, and the computer calculator, 80. 84, all right, again. Check out all the data. Make sure it's in there correctly. Then let's go to calculate linear regression. Enter. All right. So I'm just going to write down the equation for the line of best fit based on what we're seeing. We are getting Y equals one point three X we're rounding to the nearest tenth. Plus our Y intercept 73.7 and our R value 0.8 8. I think I would characterize that as sort of a moderate positive fit, right? It's not really strong, but it's not really weak either. Let's take a look at the scatter plot. Let's go back into our stat plots. We have to get rid of that residual, otherwise it would be calculating it would be plotting the residuals from this. All we need to do is change the Y list into back into L two. So we have it. Let's go into Y equals. Let's throw in our line of best fit. 1.3 X plus 73.7. And let's do zoom stat. All right, take a look at that stat plot. It's pretty good, right? You know, it's not perfect, but the data is scattered kind of randomly around the line. Definitely a positive fit again, not really strong, certainly not perfect. No, no, R value of one there. Letter B, let's get rid of the calculator now before we do letter B, we'll bring it back up in a little bit to create the residual plot. But bye bye calculator. All right, letter B asks us, what is the value of the residual associated with the data .11 94? Show the calculation that leads to your answer. So we've got this one particular data point where the input is 11 and the output is 94. And what we'd like to try to do is create or just simply calculate by hand, the residual for that particular data point. All right? Now this is pretty new. So let's kind of walk you through it again. Remember the residual is always going to be the observed value minus the predicted value. All right. Now we have the observed. That's easy enough. It's 94. The question is, what's the predicted value? In order to do that, what I need to do is actually come up with what my equation would have given me had I plugged 11 in as the input. So if I plug 11 into my line of best fit, what I'm going to get is a predicted value of 88, so my observed value is 94, my predicted value is 88, so my residual is 6. All right. All right. You know how good is that? How bad is that? I don't know. You know, I mean, if I was able to predict my GPA within 6 units or 6 points based on how many hours I studied, I think that would be pretty good. But again, look at that R value. It's only .88. So it's not amazingly strong. Okay? Now I'm going to clear this out. All right, that's gone. Let's keep going on this problem. All right, let her see says produce using your calculator, the residual graph. Doesn't have to be exact, but show your window and the correct general location of the residuals. We didn't really look at the window last time, but we'll take a look at it in a second. What I'd like you to do is pause the video right now and see if you can produce the residual graph based on what we did before, and we'll certainly walk through it again. Okay, great. Let's do it. Now remember, once we've done the linear correlation in our calculator, the residual list is sitting there, okay? So we need to go back into stat plot, but first, let's open up the TI 84 plus. All right. Let's go into the stat plot into plot number one. Let's go down to Y list. Now, remember, in order to get the residual list, if you forgot, what we're going to do is we're going to look at that stat button above it. It says list. So we're going to hit second stat, which takes us into the list menu, and we're going to go down and grab residuals. So hit enter on residual. Okay, great. So now our X values are in L one. The Y values now are the residuals. I want to turn off my line of best fit, so I'm going to hit Y equals. I'm going to clear the line at best fit out. And I'm going to let my I'm going to let my calculator decide on the good window, so I'm going to again do zoom and go down to zoom stat. Enter. And there's my residuals. Now, it says, for me to create. A plot of the residuals, not that it has to be perfect. But let's sketch it out. All right, this looks pretty good. I think I missed one. Right. Now, let's get rid of the calculator. And let's talk about that last question because this is probably the most important piece of residuals. Okay? Bye bye calculator. The last question says, why does this residual plot show a more appropriate linear model, a more appropriate linear model than the one an exercise one, even though the R value is worse? Okay? So why is that? Well, let's talk. So the R values were, sure, but since the residuals. Show no pattern. Or maybe our distributed or. Distributed randomly. Randomly that almost looks like randomly. No other model. No other model is necessarily better. No other model is necessarily better. So again, what we worry about is seeing a pattern. We worry about seeing some kind of curved pattern. Here, on the other hand, because these residuals are above below above below above, bob below, et cetera, right? A lot above a little bit below, et cetera, et cetera, it's very random. All right? So it's interesting because what the residual really does is tell us whether or not the model that we've chosen is an appropriate model. Maybe even more important if we see a pattern, then we know that the model that we've chosen is inappropriate, regardless of the R value. So I'm going to clear this out, and then we're going to go on and finish up the lesson. All right, so we've now taken a really good look at statistics, especially by variant data analysis, where we've had inputs and outputs, we fit them with lines of best fits, exponentials, quadratics. We're going to do some more of those work in our final unit. But for now, we're going to leave it alone. Let me remind you that this has been an eMac instruction common core algebra one lesson. My name is Kirk weiler, and until next time, keep thinking and keep solving problems.