1 / 11

Linear Regression

Linear Regression. A process to find the equation of a line that bests fits a set of 2-variable data. A Reasonable Estimate Median Median Line. Split the points into 3 equal parts Find the x-median and y median of each part to find median-median points

rasha
Download Presentation

Linear Regression

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linear Regression A process to find the equation of a line that bests fits a set of 2-variable data.

  2. A Reasonable EstimateMedian Median Line Split the points into 3 equal parts Find the x-median and y median of each part to find median-median points Draw the line of best fit for the 3 median–median points

  3. Residuals: • R1= Y1-[a(x1)+b] • Where a and b define the line of best fit and (x1,y1) is a point p1 • This is simply the vertical distance between point p1 and the line p1 Line of best fit R1

  4. The Least Squares Line • The line that best fits the data is the line that minimizes the square of the residuals. • (Why do you think we square them?) The Least Squares Formula Y=ax+b b = y - ax (I made a sheet to lead you through the proof of this, ask if you want it. It is not a requirement)

  5. Finding the Least Squares Line • Use Fathom • Use a Graphing Calculator • Use a spread Sheet Once you have the least squares line, you can use it to interpolate (estimate values between data points) and extrapolate (estimate values outside of the data set).

  6. Using Fathom • 1) Create a table of x and y data • 2) Drag attributes (x and y) onto the horizontal and vertical axis respectively to create a scatter plot. • 3) goto Graph in the menu and select Least Squares Line

  7. Using the TI 83 • Press STAT. • Choose 1 (EDIT). • Enter X values in L1 and Y values in L2. • To see a plot press stat plot and turn on plot 1. • Press STAT cursor over to CALC and press 4-LinReg(ax+b), hit ENTER • This gives you a and b values, you can use them to plot a line and see how it compares to your data points by pressing y= and using a and b to complete y=ax+b.

  8. Using Excel 2003 • Enter Data in 2 columns and highlight • Goto Insert, select CHART, select x-y scatter • Press NEXT,NEXT and FINISH • Select a data point with a left click, right click on it and select ADD TRENDLINE • Press the options tab and select ‘display equation on chart’

  9. Now that you have it • You can use the least squares line to predict what y value would likely go with an x value between given data points. This is called interpolating. • You can also predict what y value may go with an x value beyond the data set. This is called extrapolating. • You can also re-arrange the equation to find what x value goes with a given y value.

  10. Outliers • Consider a Least Squares Line made in fathom, watch how it changes when 1 outlier is moved. • Outliers can affect (reduce) the accuracy of a least squares line and are sometimes removed.

  11. Practice • Page 180 1,2,5,6,7

More Related