Chapter 6
CORRELATION AND REGRESSION ANALYSIS
CORRELATION ANALYSIS
Scatter Diagram (pages 241-245)
A plot of pairs of values of two variables (𝑥 𝑎𝑛𝑑 𝑦) in a rectangular coordinate
plane displaying a relationship between the two variables.
𝑥 is the independent variable, while 𝑦 is the dependent variable.
Correlation Coefficient
The measure of the strength of the linear association between two variables
Correlation is positive when 𝑦 increases as 𝑥 increases.
Correlation is negative when 𝑦 decreases as 𝑥 increases.
The value ranges from −1 perfect negative correlation to + 1
perfect positive correlation
A value of 𝑧𝑒𝑟𝑜 (0) means that there is no linear relationship between the two
variables.
CORRELATION ANALYSIS
Population Correlation Coefficient: 𝒑
Sample Correlation Coefficient: 𝒓
Sample correlation coefficient is also known as the Pearson
Product-Moment Correlation Coefficient.
𝒏 𝒏 𝒙 𝒚
𝒊=𝟏 𝒊 𝒊 − 𝒏 𝒏
𝒊=𝟏 𝒊 𝒊=𝟏 𝒚𝒊
𝒙
𝒓=
𝒏 𝒏 𝒙𝟐 − 𝒏 𝒏 𝒙 𝟐 𝒏 𝒏 𝒚𝟐 − 𝒏 𝒏 𝒚 𝟐
𝒊=𝟏 𝒊 𝒊=𝟏 𝒊 𝒊=𝟏 𝒊 𝒊=𝟏 𝒊
INTERPRETATION OF CORRELATION COEFFICIENT
Absolute Value of Correlation Strength of Linear Relationship
Coefficient Between 𝒙 𝒂𝒏𝒅 𝒚
0 − 0.2 Very Weak
0.2 − 0.4 Weak
0.4 − 0.6 Moderate
0.6 − 0.8 Strong
0.8 − 1.0 Very Strong
SAMPLE COEFFICIENT OF DETERMINATION
𝒓𝟐 × 𝟏𝟎𝟎%
The sample coefficient of determination is a measure that gives the
proportion of total variability in the dependent variable (𝑦) that could
be explained or accounted for by the linear relationship with the
independent variable (𝑥).
Example:
Page 258-260
Given each set of data below, do the following:
a. Construct a scatter plot and state the trend that each data
displays.
b. Calculate for the correlation coefficient between the two
variables and interpret.
c. Calculate the sample coefficient of determination and
interpret.
d. At 0.05 level of significance, test the significance of 𝑟 or test if
there is a significant correlation between the two variables.
1. The data below gives the test scores and the grades in
statistics of a random sample of 𝟖 students.
𝑥 𝑇𝑒𝑠𝑡 𝑆𝑐𝑜𝑟𝑒 60 66 44 70 50 64 88 62
𝑦 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐𝑠 𝐺𝑟𝑎𝑑𝑒𝑠 73 76 61 77 68 74 94 68
Solution: A. Scatter Plot
The trend is increasing, that is the points seem to follow along an
upward straight line from left to right. Hence as test scores increases,
statistics grades also increases.
100
90
80
70
Y-Values
60
50
40
30
20
10
0
0 10 20 30 40 50 60 70 80 90 100
𝑥−𝑣𝑎𝑙𝑢𝑒𝑠
Calculating for the Correlation Coefficient 𝒓, 𝒃𝟎 and 𝒃𝟏
1. 𝑴𝒐𝒅𝒆
2. 𝑺𝑻𝑨𝑻 (𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟑)
3. 𝑨 + 𝑩𝑿 (𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟐)
4. Input the 𝒙 𝒂𝒏𝒅 𝒚 values
𝑥 𝑦 𝑥 𝑇𝑒𝑠𝑡 𝑆𝑐𝑜𝑟𝑒 60 66 44 70 50 64 88 62
60 = 73 = 𝑦 73 76
𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐𝑠 𝐺𝑟𝑎𝑑𝑒𝑠 61 77 68 74 94 68
66 = 76 =
44 = 61 =
⋮ ⋮
62 68
Calculating for the Correlation Coefficient 𝒓, 𝒃𝟎 and 𝒃𝟏
5. Press AC
6. shift STAT (usually at 1)
7. Reg(𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟓)
𝟏: 𝑨 = 𝒃𝟎 2: 𝑩 = 𝒃𝟏
𝟑: 𝒓 = 𝒄𝒐𝒓𝒓𝒆𝒍𝒂𝒕𝒊𝒐𝒏 𝒄𝒐𝒆𝒇𝒇𝒊𝒄𝒊𝒆𝒏𝒕 𝟒: 𝒙 ; 𝟓: 𝒚
8. Press the number corresponding to the measure that you want to find, then press the equal
sign = .
Solution: B. Correlation Coefficient and Interpretation
Correlation Coefficient: 𝒓
𝑟 = 0.9617
Interpretation:
There is a very strong direct (positive) linear relationship between
test scores and statistics grades.
Solution: C. Coefficient of Determination and
Interpretation
Coefficient of Determination: 𝒓𝟐 × 𝟏𝟎𝟎%
𝑟 2 × 100% = 0.9617 2 × 100% = 92.49%
Interpretation:
Thus, 92.49% of the total variability of statistics grades could be
explained by the linear relationship with the statistics test scores.
Solution: D. Testing the significance of 𝒓 at
𝟎. 𝟎𝟓 level of significance
Given: 𝒏 = 𝟖 ; 𝜶 = 𝟎. 𝟎𝟓 ; 𝒓 = 𝟎. 𝟗𝟔𝟏𝟕
Let 𝑝 =𝑡ℎ𝑒 𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑒𝑐𝑖𝑒𝑛𝑡 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑡𝑒𝑠𝑡 𝑠𝑐𝑜𝑟𝑒𝑠 𝑎𝑛𝑑
statistics 𝑔𝑟𝑎𝑑𝑒𝑠
i. 𝑯𝒐 : 𝑝 = 0 (There is no correlation between test scores and
statistics grades)
ii. 𝑯𝒂 : 𝑝 ≠ 0 (There is a significant correlation between test scores
and statistics grades)
iii. Level of significance: 𝛼 = 0.05
𝑟 𝑛−2
iv. Test Statistic: 𝑡 =
1−𝑟 2
Solution: D. Testing the significance of 𝒓 at
𝟎. 𝟎𝟓 level of significance
v. Critical Region: 𝑡 < −2.447 or 𝑡 > 2.447
𝑡 ∝
,𝑛−2
=𝑡 0.05
,8−2
=𝑡 0.025,6 = 2.447
2 2
𝑟 𝑛−2 0.9617 8−2
vi. Computation: 𝑡 = = = 8.59
1−𝑟 2 1− 0.9617 2
vii. Decision: Reject 𝐻0
[Link]: At 0.05 level of significance, there is sufficient evidence that statistics
test score is a significant explanatory variable for statistics grade. Hence, there is
a significant correlation between statistics test scores and grades.
5. A school organization sells cupcakes each year as a fund
raising activity. Its members then gathered data on the
prices of cupcakes 𝒊𝒏 𝒑𝒆𝒔𝒐𝒔 and the quantities sold
𝒊𝒏 𝒏𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒑ieces from previous fund raising activity.
𝑃𝑟𝑖𝑐𝑒 𝑄𝑢𝑎𝑛𝑡𝑖𝑡𝑦 𝑆𝑜𝑙𝑑 𝑃𝑟𝑖𝑐𝑒 𝑄𝑢𝑎𝑛𝑡𝑖𝑡𝑦 𝑆𝑜𝑙𝑑
25 1000 36 950
28 1050 40 800
30 1000 45 850
33 950 50 700
35 900 55 500
Solution: A. Scatter Plot
The trend is decreasing, that is the points seem to follow along an
upward straight line from right to left. Hence as prices increases,
quantity sold decreases.
1200
1000
800
Y-Values
600
400
200
0
0 10 20 30 40 50 60
𝑥 − 𝑣𝑎𝑙𝑢𝑒𝑠
Solution: B. Correlation Coefficient and Interpretation
Correlation Coefficient: 𝒓
𝑟 = −0.9407
Interpretation:
There is a very strong inverse (negative) linear relationship
between prices and quantities of cupcakes.
Solution: C. Coefficient of Determination and
Interpretation
Coefficient of Determination: 𝒓𝟐 × 𝟏𝟎𝟎%
𝑟 2 × 100% = −0.9407 2 × 100% = 88.49%
Interpretation:
Thus, 88.49% of the total variability of quantities of cupcakes sold
could be explained by the linear relationship with their prices.
Solution: D. Testing the significance of 𝑟 at
0.05 level of significance
Given: 𝒏 = 𝟏𝟎 ; 𝜶 = 𝟎. 𝟎𝟓 ; 𝒓 = 𝟎. 𝟗𝟒𝟎𝟕
Let 𝑝 =𝑡ℎ𝑒 𝑝𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑟𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑒𝑐𝑖𝑒𝑛𝑡 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 prices and
quantities of cupcakes sold.
i. 𝑯𝒐 : 𝑝 = 0 (There is no correlation between prices and quantities
of cupcakes sold
ii. 𝑯𝒂 : 𝑝 ≠ 0 (There is a significant correlation prices and quantities
of cupcakes sold)
iii. Level of significance: 𝛼 = 0.05
𝑟 𝑛−2
iv. Test Statistic: 𝑡 =
1−𝑟 2
Solution: D. Testing the significance of 𝒓 at
𝟎. 𝟎𝟓 level of significance
v. Critical Region: 𝑡 < −2.306 or 𝑡 > 2.306
𝑡 ∝
,𝑛−2
=𝑡 0.05
,10−2
=𝑡 0.025,8 = 2.306
2 2
𝑟 𝑛−2 −0.9407 8−2
vi. Computation: 𝑡 = = = −7.84
1−𝑟 2 1− −0.9407 2
vii. Decision: Reject 𝐻0
viii. Conclusion: At 0.05 level of significance, there is sufficient evidence that the price of
a cupcake is a significant explanatory variable for the quantity sold. Hence, there is
a significant correlation between the prices of cupcakes and the quantities sold.
REGRESSION ANALYSIS
General equation of a line: 𝒚 = 𝒎𝒙 + 𝒃 where m-slope; b-y-intercept
Simple Regression Model: 𝒚 = 𝜷𝟎 + 𝜷𝟏 𝒙 + 𝜺
where x-independent variable y-dependent variable 𝛽0 𝑎𝑛𝑑 𝛽1 are
parameters, 𝜀-error
Estimated Regression Equation: 𝒚 = 𝒃𝟎 + 𝒃𝟏 𝒙
where 𝑏0 − y − intercept and 𝑏1 -slope ; 𝑏0 𝑎𝑛𝑑 𝑏1 estimates 𝛽0 𝑎𝑛𝑑 𝛽1
respectively.
When 𝑏1 is positive, then there is a direct linear relationship between the two
variables. That is a 𝑥 increases, 𝑦 increases also.
When 𝑏1 is negative, then there is an inverse linear relationship between the
two variables. That is a 𝑥 increases, 𝑦 decreases.
REGRESSION ANALYSIS
Residual: The difference between an observed value and
the predicted value.
𝒅𝒏 = 𝒚𝒏 − 𝒚𝒏
where 𝑦𝑛 - observed value and 𝑦𝑛 - predicted value
Example: page 272-273 B.# 2
For each set of data below, do the following.
A. Develop a scatter diagram for these data. Draw a straight
line through the data.
B. Compute the value of 𝑏0 and 𝑏1 .
C. Determine the least squares estimated regression line. Give an
interpretation of 𝑏0 and 𝑏1 .
D. Use the estimated regression equation to predict the value of
the dependent variable for each of the x-values given. Find
the residuals.
The data below gives the test scores and the grades in statistics
of a random sample of 𝟖 students.
𝑥 𝑇𝑒𝑠𝑡 𝑆𝑐𝑜𝑟𝑒 60 66 44 70 50 64 88 62
𝑦 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐𝑠 𝐺𝑟𝑎𝑑𝑒𝑠 73 76 61 77 68 74 94 68
Solution:
A. Scatter Plot
100
90
80
70
Y-Values
60
50
40
30
20
10
0
0 10 20 30 40 50 60 70 80 90 100
𝑥−𝑣𝑎𝑙𝑢𝑒𝑠
B. Compute for 𝒃𝟎 and 𝒃𝟏
𝒃𝟎 = 𝟐𝟗. 𝟓𝟔 𝒂𝒏𝒅 𝒃𝟏 = 𝟎. 𝟕𝟎
C. Estimated Regression Line: 𝒚 = 𝒃𝟎 + 𝒃𝟏 𝒙
𝒚 = 𝟐𝟗. 𝟓𝟔 + 𝟎. 𝟕𝟎𝒙
Interpretation:
The value of ŷ is 29.56 when the test score is 0. Since 𝒃𝟏 = 𝟎. 𝟕𝟎,
there is a positive correlation between test score and grade. Also, for
every 1 unit increase in the test score, there is a 0.70 increase in grade.
D. Predicted Values and Residuals
Observation x Predicted Values Residuals
𝒚 = 𝟐𝟗. 𝟓𝟔 + 𝟎. 𝟕𝟎𝒙 𝒅 𝒏 = 𝒚𝒏 − 𝒚 𝒏
1 60 71.56 73 − 71.56 = 1.44
2 66 75.76 76 − 75.76 = 0.24
3 44 60.36 61 − 60.36 = 0.64
4 70 78.56 77 − 78.56 = −1.56
5 50 64.56 68 − 64.56 = 3.44
6 64 74.36 74 − 74.36 = −0.36
7 88 91.16 94 − 91.16 = 2.84
8 62 72.96 68 − 72.96 = −4.96
Calculating for the mean 𝝁 𝒐𝒓 𝒙, and standard
deviation 𝝈 𝒐𝒓 𝒔
1. 𝑴𝒐𝒅𝒆
2. 𝑺𝑻𝑨𝑻 (𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟑)
3. 𝟏 − 𝑽𝑨𝑹 (𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟏)
4. Input the 𝒙 values
𝑥 𝑥 𝑇𝑒𝑠𝑡 𝑆𝑐𝑜𝑟𝑒 60 66 44 70 50 64 88 62
60 =
66 =
44 =
⋮
62
Solution: B. Correlation Coefficient and Interpretation
5. Press AC
6. shift STAT (usually at 1)
7. Var (𝑷𝒓𝒆𝒔𝒔 𝒕𝒉𝒆 𝒄𝒐𝒓𝒓𝒆𝒔𝒑𝒐𝒏𝒅𝒊𝒏𝒈 𝒏𝒖𝒎𝒃𝒆𝒓, 𝒊𝒏 𝒎𝒐𝒔𝒕 𝒄𝒂𝒍𝒄𝒖𝒍𝒂𝒕𝒐𝒓 𝒊𝒕 𝒊𝒔 𝟏)
𝟏: 𝒏 = 𝒕𝒐𝒕𝒂𝒍 𝒏𝒖𝒎𝒃𝒆𝒓 𝒐𝒇 𝒅𝒂𝒕𝒂 2: 𝒙 = 𝒎𝒆𝒂𝒏
𝟑: 𝝈𝒙 = 𝒑𝒐𝒑𝒖𝒍𝒂𝒕𝒊𝒐𝒏 𝒔𝒕𝒂𝒏𝒅𝒂𝒓𝒅 𝒅𝒆𝒗𝒊𝒂𝒕𝒊𝒐𝒏 𝟑: 𝒔𝒙 = 𝒑𝒐𝒑𝒖𝒍𝒂𝒕𝒊𝒐𝒏 𝒔𝒕𝒂𝒏𝒅𝒂𝒓𝒅 𝒅𝒆𝒗𝒊𝒂𝒕𝒊𝒐𝒏
8. Press the number corresponding to the measure that you want to find, then press the equal
sign = .