Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Regression

REGRESSION
technique concerned with predicting some
variables by knowing others
REGRESSION
tells you how values in y change as a
function of changes in values of x
REGRESSION
for prediction
REGRESSION
Line of Best Fit
Line of Best Fit
REGRESSION
Line of Best Fit
𝑦 = 𝑚𝑥 + 𝑏
Step 1
Construct a work table
according to the elements needed for the formula

Slope (m)

𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚= 2
𝑛 σ 𝑥 −(σ 𝑥)2
Step 2 Calculate Slope m

slope

𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚= 2
𝑛 σ 𝑥 −(σ 𝑥)2
Step 3 Calculate intercept b

intercept

𝑏 = 𝑦ത − 𝑚𝑥ҧ
Where:
𝑏 = y-intercept
𝑚 = slope
𝑦ത = mean of y values
𝑥ҧ = mean of x values
Step 4 Assemble the equation of the line

Where: 𝑦 = 𝑚𝑥 + 𝑏
𝑏 = y-intercept
𝑚 = slope
The following table shows the percent of water and the number of
calories in various canned soups to which 100g of water are added.
% Water (x) Calories (y) a)Find the equation of the
93.2 28 regression line for the data.
92.3 26 Round constants to the nearest
hundredth.
91.9 39
b)Use the equation to find the
89.5 56 expected number of calories in a
89.6 56 soup that is 89% water. Round to
90.5 36 the nearest whole number.
91.9 32
91.7 32
Step 1 Construct a work table
Canned Soups % Water (x) Calories (y) xy 𝑥2

A 93.2 28
B 92.3 26
C 91.9 39
D 89.5 56
E 89.6 56
F 90.5 36
G 91.9 32
H 91.7 32
σ 𝑥= σ 𝑦= σ 𝑥𝑦= σ 𝑥2 =
Step 1 Construct a work table
Canned Soups % Water (x) Calories (y) xy 𝑥2

A 93.2 28 2 609.6 8 686.24


B 92.3 26 2 399.8 8 519.29
C 91.9 39 3 584.1 8 445.61
D 89.5 56 5 012 8 010.25
E 89.6 56 5 017.6 8 028.16
F 90.5 36 3 258 8 190.25
G 91.9 32 2 940.8 8 445.61
H 91.7 32 2 934.4 8 408.89
σ 𝑥=730.6 σ 𝑦=305 σ 𝑥𝑦=27 756.3 σ 𝑥2 =66 734.3
Step 2 Calculate Slope m
𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚= 𝑛 σ 𝑥 2 −(σ 𝑥)2
Step 2 Calculate Slope m
𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚= 𝑛 σ 𝑥 2 −(σ 𝑥)2
8 27 756.3 −(730.6)(305)
= 8 66 734.3 − (730.6)2
222 050.4−222 833
=
533 874.4−533 776.36
−782.6
=
98.04
m = -7.98
Step 3 Calculate intercept b
Where:
𝑏 = y-intercept
𝑚 = slope
𝑦ത = mean of y values
𝑥ҧ = mean of x values 𝑏 = 𝑦ത − 𝑚𝑥ҧ
σ 𝑦 305
𝑦ത = =
𝑛 8
σ 𝑥 730.6
𝑥ҧ = 𝑛 =
8
=
Step 3 Calculate intercept b
Where:
𝑏 = y-intercept
𝑚 = slope
𝑦ത = mean of y values
𝑥ҧ = mean of x values 𝑏 = 𝑦ത − 𝑚𝑥ҧ
σ 𝑦 305
= 38.13 – (-7.98)(91.33)
𝑦ത = = = 38.13
=38.13– (-728.81)
𝑛 8
σ 𝑥 730.6 = 766.94
𝑥ҧ = 𝑛 =
8
= 91.33
Step 4 Assemble the equation of the line

𝑦 = 𝑚𝑥 + 𝑏
𝑦 = −7.98x + 766.94
(equation of the regression line)
Where:
𝑏 = y-intercept = -7.98 (89) + 766.94
𝑚 = slope = 56.72
Therefore , the expected number ≈ 57
of calories in a soup that is 89%
water is 57.
EXAMPLE 2 Student Mathematics(x) Physics (y)

A 65 68

The scores of 12 B 63 66

college students in C 67 68

Mathematics and D 64 65

Physics test of 80 E 68 69

items each. Predict F 62 66


G 70 68
the score in
H 66 65
Physics(y) if the
I 68 71
score in
J 67 67
Mathematics (x) of
K 69 68
students is 75.
L 71 70
Step 1 Construct a work table
Student Mathematics(x) Physics (y) 𝒙𝒚 𝒙𝟐
A 65 68 4 420 4 225
B 63 66 4 158 3 969
C 67 68 4 556 4 489
D 64 65 4 160 4 096
E 68 69 4 692 4 624
F 62 66 4 092 3 844
G 70 68 4 760 4 900
H 66 65 4 290 4 356
I 68 71 4 828 4 624
J 67 67 4 489 4 489
K 69 68 4 692 4 761
L 71 70 4 970 5 041
Σx= 800 Σy=811 Σ𝑥𝑦 = 54 107 Σ𝒙𝟐 =53 418
Step 2 Calculate Slope m

slope

𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚= 2
𝑛 σ 𝑥 −(σ 𝑥)2
Step 2 Calculate Slope m
𝑛 σ 𝑥𝑦−σ 𝑥 σ 𝑦
𝑚 = 𝑛 σ 𝑥 2 −(σ 𝑥)2
12 54 107 −(800)(811)
=
12 53 418 − (800)2
649 284−648 800
=
641 016−640 000
484
=
1 016
m = 0. 48
Step 3 Calculate intercept b

intercept

𝑏 = 𝑦ത − 𝑚𝑥ҧ
Where:
𝑏 = y-intercept
𝑚 = slope
𝑦ത = mean of y values
𝑥ҧ = mean of x values
Step 3 Calculate intercept b
Where:
𝑏 = y-intercept
𝑚 = slope
𝑦ത = mean of y values
𝑥ҧ = mean of x values 𝑏 = 𝑦ത − 𝑚𝑥ҧ
σ 𝑦 811
𝑦ത = = = 67.58 = 67.58 – (0.48)(66.67)
𝑛 12
=67.58– (32)
σ 𝑥 800
𝑥ҧ = 𝑛 12
= = 66.67 = 35.58
Step 4 Assemble the equation of the line

𝑦 = 𝑚𝑥 + 𝑏
𝑦 = 0.48x + 35.58
(equation of the regression line)
Where:
𝑏 = y-intercept = 0.48 (75) + 35.58
𝑚 = slope
= 71.58
≈ 72 in Physics is 71.58 or
Therefore , the estimated score

approximately equal to 72 if the


score in mathematics is 75.
EXAMPLE 3 Day
Hours of Ice Creams
Sunshine (x) Sold (y)

Sam found how many Monday 2 9


hours of sunshine vs
how many ice creams Tuesday 3 13
were sold at the shop
from Monday to
Wednesday 5 16
Friday.
Determine the
number of ice cream Thursday 7 20
sold if there will be 6
hours of sunshine on Friday 9 30
the next day.

You might also like