Regression and Correlation
Regression and Correlation
Regression Analysis
Correlation
Y Variable
X Variable X Variable
Y Variable
Y Variable
X Variable X Variable
Y Variable
Y Variable
X Variable X Variable
N XY − ( X )( Y)
r=
[N( X 2 ) − ( X )2 ][N( Y 2 ) − ( Y)2 ]
Test of Significance
r N−2
t=
1− r2
df = n – 2
Correlation Coefficient & Strength of Relationships
Day 1 2 3 4 5 6 7 8 9 10 11 12
Temperature (°F) 79 76 78 84 90 83 93 94 97 85 88 82
Total Sales (Units) 147 143 147 168 206 155 192 211 209 187 200 150
220
210
200
190
Sales (Y)
180
170
160
150
140
130
70 75 80 85 90 95 100
Temperature (X)
Solution 1:
Step 1: State the hypotheses.
H0: r = 0
There is no correlation between atmospheric
temperature and total sales of fruit shake.
H1: r 0
There is a correlation between atmospheric
temperature and total sales of fruit shake.
Step 2: Level of significance is α = 0.05.
N XY − ( X)( Y)
r=
[N( X 2 ) − ( X) 2 ][N( Y 2 ) − ( Y) 2 ]
= 0.93
Reject H0
0 +1.812 8.00
Step 6: Conclusion.
We can conclude that there is evidence that
shows significant association between the
atmospheric temperature and the total sales of
fruit shake.
Example 2: Spearman Rank
Day 1 2 3 4 5 6 7 8 9 10 11 12
Temperature (°F) 79 76 78 84 90 83 93 94 97 85 88 82
Total Sales (Units) 147 143 147 168 206 155 192 211 209 187 200 150
14
12
10
Rank of Y
0
0 2 4 6 8 10 12 14
Rank of X
Solution 2:
Step 1: State the hypotheses.
H0: = 0
There is no correlation between atmospheric
temperature and total sales of fruit shake.
H1: 0
There is a correlation between atmospheric
temperature and total sales of fruit shake.
Step 2: Level of significance is α = 0.05.
Day X Y RX RY D D2
1 79 147 10 10.5 –0.5 0.25
2 76 143 12 12 0 0
3 78 147 11 10.5 0.5 0.25
4 84 168 7 7 0 0
5 90 206 4 3 1 1
6 83 155 8 8 0 0
7 93 192 3 5 –2 4
8 94 211 2 1 1 1
9 97 209 1 2 –1 1
10 85 187 6 6 0 0
11 88 200 5 4 1 1
12 82 150 9 9 0 0
Total 0 D 2
= 8.5
Computation of
6 D2
= 1−
N( N2 − 1)
6(8.5) 51
= 1− = 1− = 1 − 0.03 = 0.97
12(12 − 1)
2
12(143)
Reject H0
0 +1.812 12.62
Step 6: Conclusion.
We can conclude that there is evidence that
shows significant association between the
atmospheric temperature and the total sales of
fruit shake.
Simple Regression Equation