1.5 – Linear Models

12
Essential Question: What do you do to find the least-squares regression line?

description

1.5 – Linear Models. Essential Question: What do you do to find the least-squares regression line?. 1.5 – Linear Models. When given a set of data points, the first thing to do is determine whether a straight line would be a good model for the data. - PowerPoint PPT Presentation

Transcript of 1.5 – Linear Models

Page 1: 1.5 – Linear Models

Essential Question: What do you do to find the least-squares regression line?

Page 2: 1.5 – Linear Models

1.5 – Linear ModelsWhen given a set of data points, the first

thing to do is determine whether a straight line would be a good model for the data.

A scatter plot can visually determine this. Approximately linear Not so much

Page 3: 1.5 – Linear Models

1.5 – Linear ModelsScatter plots can have a correlationIf the data appears to have a positive slope

(up & to the right), it’s a positive correlationIf the data appears to have a negative slope

(down & to the right), a negative correlationIf a straight line isn’t possible, we say the

data has no correlation or very little correlation

Page 4: 1.5 – Linear Models

1.5 – Linear ModelsYou can also determine whether a line is a good

fit by using finite differences.Finite differences are determined by subtracting

consecutive y-coordinate data pointsExample 1: Linear Data

Estimated cash flows from a company over the five-year period 1988-1992 are shown in the table

Year 1988 1989 1990 1991 1992

Cash flow per share ($)

2.38 2.79 3.23 3.64 4.06

Page 5: 1.5 – Linear Models

1.5 – Linear Models

2.79 – 2.38 = 0.413.23 – 2.79 = 0.443.64 – 3.23 = 0.414.06 – 3.64 = 0.42

Because the differences are approximately equal, a line is a good model for this data, and the data shows a positive correlation

Year 1988 1989 1990 1991 1992

Cash flow per share ($)

2.38 2.79 3.23 3.64 4.06

Page 6: 1.5 – Linear Models

1.5 – Linear Models(Bonus Content)We now enter the area of stuff that I’m not going

to test you on, but is just really cool

A residual is the distance from a real data point to it’s point on a linear model (see board)

To find the line of best fit, we square the residuals. The closer the square of the residuals for all points is to 0, the better the model

For any scatter plot, there is only one true “line of best fit”, which is the line where the square of the residuals is as small as possible.

Page 7: 1.5 – Linear Models

1.5 – Linear Models(Bonus Content)Your calculator has a function for linear

regression (LinReg), which can calculate the line of best fit.

Refresher: Adding functions to the calculator2nd, Custom, F1, F3We’ll need to add three functions for all of this:

LinR, Plot1, Zdata

Page 8: 1.5 – Linear Models

1.5 – Linear Models(Bonus Content)We’ll use the data from example 2 in the book

We need to store our x and y data in lists1)Open the list menu (2nd, ‘−’)2)Use the curly braces (F1, F2) to input the x data points,

then use the STO button (above the On key) to store your value as a variable1) {0,1,2,3,4,5,6}X (note, we’re using a capital X –

the ‘+’ key – here)2) {1,2,2,3,3,5,5} Y (the capital Y is the ‘0’ button)

Advertising Expenditure 0 1 2 3 4 5 6

Sales Revenue 1 2 2 3 3 5 5

Page 9: 1.5 – Linear Models

1.5 – Linear Models(Bonus Content)We now use the linear regression function

LinR(xData,yData)We stored our xData in ‘X’ and yData in ‘Y’, so the

command for the calculator is: LinR(X,Y,y1)

You should receive the following output LinReg

y=a+bx a=.964285714 b=.678571429 corr=.959644917 n=7

So what the heck does that all mean?

Page 10: 1.5 – Linear Models

1.5 – Linear Models(Bonus Content) LinReg

y=a+bx a=.964285714 b=.678571429 corr=.959644917 n=7

If we substituted the a and b values into the top equation, we’d get y = .964285714 + .678571429x [let’s reorder] y =.678571429x + .964285714 So a line with an intercept ≈ .964 and a slope ≈ .679 is our line

of best fit ‘corr’ stands for coefficient correlation. The closer corr is to 1 or -1,

the better the fit. ‘n’ is the number of points

Page 11: 1.5 – Linear Models

1.5 – Linear ModelsSo what’s the use?We can have the calculator graph the line for us using the

Plot1 functionPlot1(graph type, xData, yData)

We need graph type 1 (scatter plot), so our command is: Plot1(1,X,Y) The calculator will simply say ‘Done’ in response

To see the plot, we need ZData Just press ZData and Enter

The graph will auto draw for youYou can change the view of the graph with ‘Wind’ (F2)

Page 12: 1.5 – Linear Models

1-5 Linear ModelsHW: Pg. 53, 4-15 (All)

This is potential quiz/test material, covering describing correlations and finite differences

EC: 16-22 (All)These are questions using linear regression.

You will need a graphing calculator to accomplish these.

Completing 16-22 (all) will result in an extra credit homework assignment