STAT1306/STAT1603 Ch 8 1
Regression
• 𝑌𝑌 – response variable
• (variable of our particular interest)
• 𝑋𝑋 – explanatory variable
• Assume 𝑋𝑋 causes 𝑌𝑌, for example,
– 𝑋𝑋: length of the ears
Cause
– 𝑌𝑌: life span
– In this example, which is 𝑋𝑋?
– Which variable is 𝑌𝑌?
STAT1306/STAT1603 Ch 8 2
Regression
• The model is Random error
STAT1306/STAT1603 Ch 6 4
Covariance
STAT1306/STAT1603 Ch 6 5
Correlation
• For two random variables 𝑋𝑋 and 𝑌𝑌, their
correlation is
𝐶𝐶𝐶𝐶𝐶𝐶(𝑋𝑋, 𝑌𝑌)
𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑋𝑋, 𝑌𝑌 = 𝜌𝜌 =
𝑉𝑉𝑉𝑉𝑉𝑉(𝑋𝑋) 𝑉𝑉𝑉𝑉𝑉𝑉(𝑌𝑌)
• This is a measure of the strength and
direction of the “linear relationship” of two
quantities.
• Note: there exists other “non-linear”
relationship between variables which
cannot be quantified by 𝜌𝜌.
STAT1306/STAT1603 Ch 8 6
Correlation
• Note that
−1 ≤ 𝜌𝜌 ≤ +1
• If 𝜌𝜌 < 0, then 𝑋𝑋 and 𝑌𝑌 have a negative
linear relationship. (negatively correlated)
• If 𝜌𝜌 = 0, then 𝑋𝑋 and 𝑌𝑌 are not linearly
related. (uncorrelated)
• If 𝜌𝜌 > 0, then 𝑋𝑋 and 𝑌𝑌 positively
associated. (positively correlated)
STAT1306/STAT1603 Ch 8 7
Correlation
• In the extreme cases,
• 𝜌𝜌 = +1
– 𝑋𝑋 and 𝑌𝑌 are perfectly positively correlated.
• 𝜌𝜌 = −1
– 𝑋𝑋 and 𝑌𝑌 are perfectly negatively correlated.
• In these two cases, all the (bivariate)
observations fall on a straight line in the
scatter diagram.
STAT1306/STAT1603 Ch 8 8
Correlation
STAT1306/STAT1603 Ch 8 10
Some Data Management Skills…
1
STAT1306/STAT1603 Ch 8 11
Using Excel to find Correlation
STAT1306/STAT1603 Ch 8 12
Section 8.1.1 Hypothesis Testing
• Testing for Significant Linear Association
𝐻𝐻0 : 𝜌𝜌 = 0 vs 𝐻𝐻1 : 𝜌𝜌 ≠ 0
• Then, with the bivariate normality assumption Just and
under 𝐻𝐻0 , skip it!
𝜌𝜌� 𝑛𝑛 − 2
𝑇𝑇 = ~𝑡𝑡 𝑛𝑛−2
1 − 𝜌𝜌�2
• For testing 𝐻𝐻0 : 𝜌𝜌 = 𝜌𝜌0 vs 𝐻𝐻1 : 𝜌𝜌 ≠ 𝜌𝜌0 ,
1 1 + 𝜌𝜌� 1 1 + 𝜌𝜌0
ln − ln
2 1 − 𝜌𝜌� 2 1 − 𝜌𝜌0
𝑍𝑍 = ~𝑁𝑁 0,1
1/ 𝑛𝑛 − 3
STAT1306/STAT1603 Ch 8 13
Section 8.1.2 Fallacies
• Consider
𝑋𝑋 = Age, 𝑌𝑌 = Weight, 𝑍𝑍 = IQ
• Study:
– Growth of the young children aged 3 to 11
• 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑋𝑋, 𝑌𝑌 = 0.8
• 𝐶𝐶𝐶𝐶𝐶𝐶𝐶𝐶 𝑋𝑋, 𝑍𝑍 = 0.68 𝑌𝑌 𝑍𝑍
STAT1306/STAT1603 Ch 6 15
STAT1306/STAT1603 Ch 8 16
Example 8.3
STAT1306/STAT1603 Ch 8 17
STAT1306/STAT1603 Ch 8 18
STAT1306/STAT1603 Ch 8 19
STAT1306/STAT1603 Ch 8 20