Linear Regression
Y = a + bx
n ∑ XY −∑ X ∑ Y
b=
n ∑ x 2−¿ ¿ ¿
a = y - bx
Examples:
1. The following are the result of midterm exam (X) and the
final grades (Y). Show that there is a significant
relationship between the result of midterm exam and the
final grade at α = 0.05.
2
X Y XY X Y2
75 80 6000 5625 6400
70 75 5250 4900 5625
65 65 4225 4225 4225
90 95 8550 8100 9025
85 90 7650 7225 8100
85 85 7225 7225 7225
80 90 7200 6400 8100
70 75 5250 4900 5625
65 65 4225 4225 4225
90 90 8100 8100 8100
∑X ∑Y ∑ XY ∑ X =
2
∑Y =
2
=77 =810 = 60925 66650
5 63675
N = 10
In example above, if the midterm score is x = 88, what is the value of
final grade?
Solution:
n ∑ XY −∑ X ∑ Y
b=
n ∑ x 2−¿ ¿ ¿
10 ( 63675 )−( 775 ) (810)
=
10 ( 60925 )−¿ ¿
636750−627750
= 609250−600625
9000
= 8625
b = 1.04
a = y - bx
y = 81
x = 77.5
a = 81 - (1.04)(77.5)
= 81 – 80.6
a = 0.4
For grade
Y = a + bx
= 0.4 + (1.04)(88)
=0.4 + 91.5
Y = 91.9 or 92
2. A study is conducted on the relationship of the number of absences
(X) and the grades of 15 students in Statistics (Y). Using 0.05 LS
prove that there is no significant relationship between absences
and grades of 15 students in Stat. Predict the grade of stdent 1ith 7
absences.
X Y XY X2 Y2
1 90 90 1 8100
2 85 170 4 7225
2 80 160 4 6400
3 75 225 9 5625
3 80 240 9 6400
8 65 520 64 4225
6 70 420 36 4900
1 95 95 1 9025
4 80 320 16 6400
5 80 400 25 6400
5 75 375 25 5625
1 92 92 1 8464
2 89 178 4 7921
1 80 80 1 6400
9 65 585 81 4225
∑X ∑Y ∑ XY ∑ X = ∑Y =
2 2
=53 =1201 = 281 97335
3950
N =15
r ¿ n ∑ XY√−¿∑
¿¿
X∑Y
r ¿ 15 ( 3950√) −¿ (¿53¿ ) (1201)
59250−63653 −4403 −4403
= √[4215−2809][1460025−1442401] = √ [ 1406 ][ 17624] = √24779344
−4403
= 4977.88 = -0.88, - SR
n−2 15−2 15−2
=−0.88 = −0.88
tr=r
√ 1−r 2 √ 1−(−0.88)2 √ 1−0.7744
13
=−0.88 √ 0.2256
= −0.88 √ 57.62 = -0.88(7.59) = - 6.68
Df = 13, CV = 0.514
I.
II.
III.
IV.
V.
n ∑ XY −∑ X ∑ Y
b=
n ∑ x 2−¿ ¿ ¿
15 ( 3950 )−( 53 ) (1201)
=
15 (281)−¿ ¿
59250−63653
= 4215−2809
−4403
= 1406
b=1
a = y - bx
y = 80.07
x = 3.53
a = 80.07 - (- 3.13)(3.53)
= 80.07 – (-11.05) = 80.07 + 11.05
a = 91.12
For grade for 7 absences
Y = a + bx
= 91.12 + (-3.13)(7)
=91.12 + (-21.91) = 91.12 – 21.91
Y = 69.21 or 69