Anda di halaman 1dari 9

Least-Squares Regression Line

The process of fitting a straight line to bivariate data is known as linear


regression. Knowing the equation of the line gives us a better understanding of
the nature of the association & enables us to make predictions.
The easiest way is to fit a line by eye after constructing a scatterplot,
unfortunately, this method results in a lot of variation & is the least accurate
method of regression.
(x4,y4)

An example of a scatterplot with a regression line


is shown. The vertical distances d1, d2, etc of each
data point are known as residuals
(more on this later).

(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

Least-Squares Regression Line


To fit a straight line by eye, make sure:
there are an equal number of points above and below the line
the points above/below are spread evenly along, not bunched at one end.
Which one of the regression lines fitted to the scatterplot alongside best captures
the general pattern of data?

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.

Method 1 (extrapolate y int):

Method 2 (use y y1 = b (x x1)):

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

Method 2 (use y y1 = b (x x1)):


b = -2 (as above)
y y1 = b (x x1)
y 60 = -2 (x 20)
= -2x + 40
y = -2x + 100

Determining Equation of Least Squares Line using the following


formula:

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=

Determining Equation of Least Squares Line using the following


formula:

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

Determining Equation of Least Squares Line using the


ClassPad:

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

Anda mungkin juga menyukai