Constructing models of data sets using technology and regressions

Learn this with friends

MathsAP®︎/College Precalculus6:177 check-ins

About this video

Using a TI-84 calculator, the video enters four data points, turns on diagnostics to see R squared, and runs both a linear and a quadratic regression. The line fits poorly (R squared about 0.596) while the quadratic y = -1.0675x^2 + 8.6395x - 12.9595 fits almost perfectly, which the graph confirms.

You'll be able to

  • enter data into lists and run a linear or quadratic regression with a graphing calculator.
  • use R squared to judge how well a model fits data.
  • choose between a linear and a quadratic model by looking at the shape of the data.

Key words

regression
A method for finding the equation of the model that best fits a set of data points.
R squared
A number from 0 to 1 showing how much of the data the model explains; closer to 1 means a better fit.
quadratic regression
Fitting a curve of the form y = ax^2 + bx + c to data.
diagnostics
A TI-84 setting that must be turned on so the calculator shows R squared.
Transcript

- [Instructor] What we're gonna do in this video is learn to interpret some data using technology. And we're gonna use an old school TI-84 calculator. Not too different than the calculator I used. Boy, I feel old now over, well, roughly 30 years ago when I was in high school and there's other tools, but maybe you have one of these yourself.

So it wouldn't hurt to use this. These calculators are a little bit, the user interface isn't as smooth as what we're used to these days, but let's give it a shot. So the first thing we wanna do is enter these, this data right over here. So what we want to do is go to stat, we'll be using this button a lot.

And then we want to edit our data so we can either just hit one or hit enter where we are. So I'll hit ent one, and so we'll enter the data points. So two, enter. So this is all of the X's in this column, in the L1. I'll do all the X's and then I'll do all the Y's in the L2.

So two, three, enter, four enter, and then five enter. And now we'll go to the Y's. When X is two, Y is 0.1, enter, 3.2, enter, 4.67, 4.67 enter. And then last but not least, 3.5. All right, that was fun. We've entered the data, but now let's do something interesting with the data.

Let's see if we can find, if we can fit either some type of a line or even a quadratic to this data. Now if you're using a TI-84 like this, it's important to turn on the "diagnostics" so that you can get the R squared value to see how good of a fit it is. And now to do that, we're gonna, this is some of this old school stuff.

We're gonna go to the catalog of functions, so that second and then the zero button right over here. And we can go, we can just scroll down. Let's just scroll down super fast. Not that fast. We're looking for diagnostics. So we're almost at the D. We want to go to diagnostic on.

Diagnostic on. There you go. So now we'll get, and we click enter, we'll get the R squared values. Now we can go back to our stat menu. We can go to calc, calculate. And now let's see, let's do the linear regression. I could either just hit the number four or I could go down and select four, enter.

And let's see, the X list is L1, the Y list is L2. And you don't have to worry about the frequency list right over there. But what I do want to do here is I actually wanna store this so that I can graph it in a little bit. So let me go right here to VARS or variables.

And what I'm gonna do is the YVARs function. I'm going to use, I'm going to make, use this regression as Y1. So I'll click enter right over there, and now I'll hit calculate and it will give me an equation. It'll try to fit a line to this data and it'll also tell me how good of a fit this is.

So let's click enter. And so we have the equation of this line that it fit is y is equal to 1.167 x plus, or I would just to say minus 1.217. And the R squared is 0.596. So it's about 0.6. So that's how much of the data you can explain with this line. So it's okay, the higher the R squared, the closer to one you are, the better a fit it is.

And if it's close to zero, it's a very bad fit. But anyway, that was a linear regression and we try to remember that it was about 0.6, a little under 0.6. Now let's try to do a quadratic regression and then we will actually try to graph it. So I'll go back to stat and I'll go back to calculate.

And now I'll do a quadratic regression and I'm still gonna use the same X's and Y's. And actually I am going to, I want to graph this as well. So I will put that under Y2. So I'm gonna hit function and I'm gonna put graph that with Y2. So I'll be able to graph both of those. Enter.

And now let's see what type of an R squared we get. Well, we got a very good R squared. So when you're dealing with real data in the real world, you very seldom get an R squared that strong. This almost perfectly explains the data this quadratic. So they tell us what the A, the B, and the C is.

So this would be Y is equal to negative 1.0675 x squared, plus 8.6395 x minus 12.9595. Now, to just visualize that, now we can graph it and let's, I'm gonna graph it so it actually shows the data. So I will, or right where our data is. So I'm gonna go to zoom stat right there.

I could have just hit nine, but I want you to see it. So I'm gonna click enter, and that is one of the regressions. That's the other, but I don't see my data points, so let's work on that. To do that, we press second stat plot right over there. And so I will do plot one.

I will do that as being on. All right, now let me go back to my zoom button and I can go down to number nine. Now, let's see if it works. There we go. We have our four data points, we have the linear regression, and then we see that quadratic regression, that quadratic line almost perfectly fits it.

And that's why the R squared was so high while for the line, you know, I mean it kind of seems to kind of fit it, but there's still, it doesn't explain all of it. And you clearly see these points. Two, 0.1, that's two 0.13, three, 3.2, four, 4.67, five, and 3.5.

Video © Khan Academy, used under CC BY-NC-SA. Watch on Khan Academy. Puzzicle is not affiliated with Khan Academy.