200 likes | 258 Views
Linear regression. Linear Regression. In this lesson you will learn: How to calculate a least squares regression line and use it to make predictions. How to use residuals How a regression equation is effected by a linear transformation of either of the variables.
E N D
Linear Regression • In this lesson you will learn: • How to calculate a least squares regression line and use it to make predictions. • How to use residuals • How a regression equation is effected by a linear transformation of either of the variables.
The least squares regression line At GCSE you did a line of best fit to describe correlation which was a bit of a guessing game a bit hit and miss. • But now you will learn a slightly more accurate method ‘the method of least squares’ to calculate the line of regression.
Calculating the Line of RegressionUsing – the equation of a straight line y=mx+c • Get the mean of all the x values • Get the mean of all the y values and use the following equation (from C1) • Plot the point this is the only point that we know on the line of regression. • The only thing to do now is work out the gradient (m)
Find the gradient You need the different forms as problems will be presented in different ways.
Task • Exercise A • page 127
Explanatory variables • which makes more sense to you: • The sale of ice-cream affects the temperature • The temperature affects the sales of ice-cream • Temperature is the ‘Explanatory Variable’ and therefore the one we call x
Task • Exercise B
Scaling- you could do each value or just apply it to the whole equation If the temperature were given in Fahrenheit (t) the values would need converting or the equation would need rewriting in terms of Fahrenheit (t)
Task • Exercise C • page 130
Residualsthe difference between Practice and Theory • A residual is the difference between observed y-value and the predicted y-value using the line of regression. • Residuals are shown by a vertical line from the line of regression. http://www.math.csusb.edu/faculty/stanton/m262/regress/regress.html http://www.math.csusb.edu/faculty/stanton/probstat/regression.html both of these show how each item of data will have an affect on the line of regression. Can you work out what it is?
Calculating the residuals This is because we have calculated regression line using the method of least squares.
TASK • Exercise D • Page 132
Calculating the residuals Can you think of any problems we might have with our line of regression?
Calculating the residuals What can we do to improve our line of regression? Tip you may have already been told what to do with a line of best fit at GCSE maths
Linear Regression • The main points of the lesson were: • How to calculate a least squares regression line and use it to make predictions. • How to use residuals • How a regression equation is effected by a linear transformation of either of the variables.