Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Essential Question: What do you do to find the least-squares regression line?"— Presentation transcript:

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

2 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. A scatter plot can visually determine this. Approximately linear Not so much

3 1.5 – Linear Models Scatter plots can have a correlation If the data appears to have a positive slope (up & to the right), it’s a positive correlation If the data appears to have a negative slope (down & to the right), a negative correlation If a straight line isn’t possible, we say the data has no correlation or very little correlation

4 1.5 – Linear Models You can also determine whether a line is a good fit by using finite differences. Finite differences are determined by subtracting consecutive y-coordinate data points Example 1: Linear Data Estimated cash flows from a company over the five-year period 1988-1992 are shown in the table Year19881989199019911992 Cash flow per share ($) 2.382.793.233.644.06

5 1.5 – Linear Models 2.79 – 2.38 = 0.41 3.23 – 2.79 = 0.44 3.64 – 3.23 = 0.41 4.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 Year19881989199019911992 Cash flow per share ($) 2.382.793.233.644.06

6 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.

7 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 calculator 2 nd, Custom, F1, F3 We’ll need to add three functions for all of this: LinR, Plot1, Zdata

8 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 lists 1) Open the list menu (2 nd, ‘ − ’) 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 variable 1) {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 Expenditure0123456 Sales Revenue1223355

9 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?

10 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

11 1.5 – Linear Models So what’s the use? We can have the calculator graph the line for us using the Plot1 function Plot1(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 you You can change the view of the graph with ‘Wind’ (F2)

12 1-5 Linear Models HW: 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


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

Similar presentations


Ads by Google