Mathematics in the Modern World – UNIT 4
Correlation &
Simple Linear Regression
Mathematics & Physics Department
University of Santo Tomas
Prepared by:
Asst. Prof. Xandro Alexi A. Nieto
Correlation
To determine the direction and
magnitude of the linear relationship
between two quantitative variables,
X and Y.
Correlation
Pearson Product Moment Correlation
𝑛 σ 𝑥𝑦 − σ 𝑥 σ 𝑦
𝑟=
2 2 2 2
𝑛 σ𝑥 − σ𝑥 𝑛 σ𝑦 − σ𝑦
Correlation
Example: For the following data on heights and weights of 14
UAAP Basketball players, determine if heights and
weights are correlated.
Height, X Weight, Y
77 230
76 225
77 241
72 209
76 225
77 235
77 228
74 214
74 240
75 233
74 225
76 220
74 222
76 225
Sums: 1055 3172
Correlation
Height, X Weight, Y X2 Y2 XY
77 230 5929 52900 17710 n σ xy − σ x σ y
76 225 5776 50625 17100 r=
2 2 2 2
77 241 5929 58081 18557 n σx − σx n σy − σy
72 209 5184 43681 15048
76 225 5776 50625 17100
77 235 5929 55225 18095
77 228 5929 51984 17556
74 214 5476 45796 15836
74 240 5476 57600 17760
75 233 5625 54289 17475
74 225 5476 50625 16650
76 220 5776 48400 16720
74 222 5476 49284 16428
76 225 5776 50625 17100
Sums: 1055 3172 79533 719740 239135
5
Simple Linear Regression
To determine the equation of the best-fit line
(least squares error)
Equation of the best fit line: Y = a + bX
n σ xy − σ x σ y
b= 2
n x − σx
σ 2
σy σx
a= −b
n n
6
Simple Linear Regression
Example: For the following data on heights and weights of 14
UAAP Basketball players, determine the equation
of the best-fit line
Height, X Weight, Y
77 230
76 225
77 241
72 209
76 225
77 235
77 228
74 214
74 240
75 233
74 225
76 220
74 222
76 225
1055 3172
7
Simple Linear Regression
Height, X Weight, Y X2 Y2 XY
77 230 5929 52900 17710 n σ xy − σ x σ y
76 225 5776 50625 17100 b= 2
n σx − σx 2
77 241 5929 58081 18557
72 209 5184 43681 15048
76 225 5776 50625 17100
77 235 5929 55225 18095
77 228 5929 51984 17556
74 214 5476 45796 15836
74 240 5476 57600 17760
75 233 5625 54289 17475
σy σx
74 225 5476 50625 16650 a= −b
76 220 5776 48400 16720 n n
74 222 5476 49284 16428
76 225 5776 50625 17100
1055 3172 79533 719740 239135
=INTERCEPT(Y:X)
8
8
Simple Linear Regression
Equation of the best fit line:
Y= ,
where Y is the weight (lbs)
and X is the height (inches)
9
Simple Linear Regression
Estimate the weight of a
player with
height of 71 inches.
10
10
END OF UNIT 4.4