Linear Regression
Linear Regression
�� is the slope;
�� is the sample size;
��
���� ����is the some of all products of x and y;
��=1
��
����is the sum of all y;
��=1
��
����2is the sum of all X2;
��=1
��
����2is the square of the sum of all x;
��=1
b is the y-intercept;
�� is the mean of all y;
�� is the mean of all x.
1 4 5 20 16
�� = 0.884146
2 5 4 20 25
3 9 8 72 81
4 2 3 6 4
b = �� − �� ��
b = 5 - 0.884146 (4.8)
5 8 9 72 64
b = 0.756098
6 1 2 2 1
7 2 1 2 4 Substituting in y = mx + b and
8 7 6 42 49 rounding off to two decimal places, the linear regression equation is
9 6 7 42 36
y = ��. ���� + ��. ���� ��
10 4 5 20 16
Thus, the student who got 3 score in mathematics quiz will have also a
�� = 10 10 10 10 10
score of 3 in English test, as shown below.
����2 = 296
���� = 48 ���� = 50 �������
��=1 ��=1
� = 298 ��=1 y = 0.76 + 0.88 ��
48 50
��=1
y = 0.76 + 0.88 (3)
�� = 10 = 4.8 �� = 10 = 5 y = 3.41 or 3
y = 6.24 + (−0.2365) ��
�� = [ 9 255 − 55 43 ]
2
[(9) 369 − 55 ] Thus, the student who got 10 score in Chemistry will have a score of 4 in
Physics, as shown below.
�� = - 0.2365
y = 6.24 + (−0.2365) ��
b = �� − �� �� y = 6.24 + (−0.2365) (10)
b = 4.8 – (-0.2365)(6.1)
b = 6.24 y = 3.875 or 4
x y x y x^2
chem scoresphys scores
3 6 18 9 6 5 30 36 5 7 35 25 8 6 48 64 9 2 18 81 4 3 12 16 5 4 20 25 7 6 42 49 8 4 32 64 55 43 255 369
sum of x sum of y sum of xy sum of x^2 6.111111 4.777778
x mean y mean
m -0.23649 -0.236486
ACTIVITY 9 - LINEAR REGRESSION
PROBLEM A. The table below indicates the total number of enrolees of Ezrah Academy and the corresponding profit from 2008
to 2016.
��
Substituting the values to the formulas: ���� ���� − ��=1
��
���� ��=1
a. Compute for m and b in the linear �� ) �� = �� −( )( ) (��) − ( )��
regression equation. b. Give the regression ��
�� ��
equation. �� =�� ��=1 ��
����2
c. Predict the school’s profit in 2017 , the ��
����2 − ��=1
y , when the total enrolment is 12,000 (the
�� ��=1
�� = −( )( ) y = ______
PROBLEM C.
A real estate agent wishes to examine the relationship between the selling price of a home and its size (measured in square
feet). Predict the price for a house with 2000 square feet.