(x2,y2)
(x1,y1)
d1
d2
d5
d4
d3
(x5,y5)
(x3,y3)
The least squares line is the line where the sum of the squares of the residuals is
as small as possible.
It is used when:
data is numerical
show a linear relationship and
have no clear outliers.
Refer Ch 4A
widget
Example 1: Fit a straight line to the data in the scatterplots using the fit by eye method.
When you fit a line by eye, you are also able to determine the equation of the line.
In each case, the regression line is of the form y = a + bx where
x - explanatory variable (horizontal axis)
y - response variable (vertical axis)
b - slope or gradient of the line or
a - y-intercept of the line.
Example 2: Draw a line of best fit by eye & find the equation of your line.
Example 2: Draw a line of best fit by eye & find the equation of your line.
Method 1 (extrapolate y int):
(10,8
0)
(20,6
0)
b = 80 60
10 4
= -2
a = 100
y = -2x + 100
y = a + b where:
the slope (b) is given by
and
the intercept (a) is given by
This method can only be used when you are given the correlation
coefficient (r), standard deviation of x and y (sx, sy) and mean values of x
and y (x,y).
Example 3
Given x = 52; y = 152; sx = 16.0208; sy = 21.2394 and r = 0.7951,
determine the equation of the least squares regression line to 4
decimal places.
b = rsy =
a = y - bx =
y=
y = a + b where:
the slope (b) is given by
and
the intercept (a) is given by
This method can only be used when you are given the correlation
coefficient (r), standard deviation of x and y (sx, sy) and mean values of x
and y (x,y).
Example 3
Given x = 52; y = 152; sx = 16.0208; sy = 21.2394 and r = 0.7951,
determine the equation of the least squares regression line to 4
decimal places.
b = rsy =
0.7951 x 21.2394
a = y - bx = 152
1.0541 x 52
16.0208
= 97.1868
= 1.0541
This method can only be used when you are given the actual data
values. You MUST make sure that you correctly identify the
explanatory variable and response variable.
Example 4
The age and blood pressures of 10 people have been recorded.
Determine the equation of the least squares regression line that will
enable blood pressure to be predicted from age.
To obtain the least squares linear regression for the 2-variable data,
enter the x values in List1 and the y values in List2 then Calc Lin
Reg (old) or Calc Regression Lin Reg (new). If relevant, rewrite the
equation with the variable names.
y = 97.1861 + 1.0541x
Blood pressure = 97.1861 + 1.0541 x Age