Beruflich Dokumente
Kultur Dokumente
a= and b=
Example Problem
Find the least square regression line for the points (-3, 0),
(-1, 1), (0, 2), and (2, 3)
The table shows the calculations involved in finding the
least square line using n = 4.
x y xy x2
-3 0 0 9
-1 1 -1 1
0 2 0 0
2 3 6 4
= 2 = 6 = 5 2 = 14
=1 =1 =1 =1
x y xy x2
-3 0 0 9
-1 1 -1 1
0 2 0 0
2 3 6 4
= 2 = 6 = 5 2 = 14
=1 =1 =1 =1
a= and b=
Since we arrange the data, we can now substitute it to the
variables in the formula.
And through direct substitution we get,
a= b =
4 5 2 (6) 1 8
= = [(6 2 ]
4 14 2 2 4 13
8 47
= =
13 26
Now we have the value of a and b, we can now get the
equation for the least square regression line from the
formula f(x) = ax + b,
8 47
The value of a = and the value of b =
13 26
-3 -2 -1 1 2 3
2. The sales of a company (in million dollars) for each
year are shown in the table below.
x
2005 2006 2007 2008 2009
(year)
y
12 19 29 37 45
(sales)
a) Find the least square regression line y = ax + b.
0 12 0 0
1 19 19 1
2 29 58 4
3 37 111 9
4 45 180 16
x = 10 y xy x 2
=1 =1 =1 =1
= 142 = 368 = 30
a) Find the least square regression line y = ax + b.
-We now calculate a and b using the least
square regression formulas for a and b.
n
=1 xy=1 x (=1 y) 1
a= b= (=1 y =1 x)
n =1 x 2 (
=1 x)
2
5 368 10(142) 1
a= b= (142 8.4(10))
5 30 (10)2 5
42 58
a= =8.4 b= =11.6
5 5
Sum of the Squared Errors
Sum of the Squared Errors
S=
=1[() yi] 2
Since we know how to get the least square regression line. We
can now get the estimated sum of the squared errors.
S==1[() yi] 2
S= =1[ + b yi] 2
Let us get the sum of the squared errors from this table.
Since we get the values of a and b earlier which is :
0 12 0 0
1 19 19 1
2 29 58 4
3 37 111 9
4 45 180 16
x = 10 y xy x 2
=1 =1 =1 =1
= 142 = 368 = 30
Applying the formula,
S= =1[ + b yi] 2
We get: