Professional Documents
Culture Documents
Correlation and Regression
Correlation and Regression
If the change in one variable affects a change in the value of the other variable,
the variables are said to be correlated.
Coefficient of correlation
It is a numerical measure of linear relationship of two variables x and y , it
is denoted by r ( x, y ).
xy x . y
That is, r ( x, y ) n where x
x , y
y.
x 2
(x ) . 2 y 2
( y )2
n n
n n
Problem
1. Calculate the correlation coefficient for the following data
x 1 3 5 8 9
y 3 4 8 10 12
x y xy x2 y2
1 3 3 1 9
3 4 12 9 16
5 8 40 25 64
8 10 80 64 100
9 12 108 81 144
10 11 110 100 121
36 48 353 280 454
Now, x
x 36 6 , y
y 48 8
n 6 n 6
xy x . y 353
48
r ( x, y ) n 6 0.97
x ( x )2 .
2
y 2 ( y )2 280
36.
454
64
n n 6 6
Practice Problem
x 65 66 67 67 68 69 70 72
y 67 68 65 68 72 72 69 71
Solution: r ( x, y) 0.603
Rank Correlation Coefficient:
Problem
1. The rankings of ten students in two subjects A and B are as follows:
A 3 5 8 4 7 10 2 1 6 9
B 6 4 9 8 1 2 3 10 5 7
Find the rank correlation coefficient.
Solution:
A ( xi ) B ( yi ) d i ( xi yi ) di2
3 6 -3 9
5 4 1 1
8 9 -1 1
4 8 -4 16
7 1 6 36
10 2 8 64
2 3 -1 1
1 10 -9 81
6 5 1 1
9 7 2 4
0 di
2
214
6 di2 6(214)
The rank correlation coefficient is r 1 1 0.297 =
n(n 1)
2
10(102 1)
m(m2 1)
Note: When we have repeated ranks, we have to use correction factor
12
Where m represents the number of times the data repeated.
2. The following table gives the number of units rejected by two operators X and Y in 8
inspections:
X 15 20 28 12 40 60 20 80
Y 40 30 50 30 20 10 30 60
Obtain rank correlation coefficient between X and Y with respect to the quality of
the product.
Solution:
X Y Ranks in X ( xi ) Ranks in Y ( yi ) di ( xi yi ) di2
15 40 2 6 -4 16
20 30 3.5 4 -0.5 0.25
28 50 5 7 -2 4
12 30 1 4 -3 9
40 20 6 2 4 16
60 10 7 1 6 36
20 30 3.5 4 -0.5 0.25
80 60 8 8 0 0
2
di 81.5
m(m2 1) 2(22 1) 1
In X series 20 repeated twice, correction factor
12 12 2
m(m2 1) 3(32 1)
In Y series 30 repeated thrice, correction factor 2
12 12
1
681.5 2
Therefore, r ( X , Y ) 1 0
2
2
8(8 1)
Practice Problem:
1. The marks secured by recruits in the selection test X and in the proficiency test
Y are given below:
Serial No. 1 2 3 4 5 6 7 8 9
X 10 15 12 17 13 16 24 14 22
Y 30 42 45 46 33 34 40 35 39
Calculate the rank correlation coefficient.
Solution:0.4
Problem:
1. Given r12 0.7 , r13 0.61 and r23 0.4 . Find the partial correlation coefficients.
Multiple correlation
In multiple correlation, we are trying to make estimates of the value of one of the
variable based on the values of all the others. The variable whose value we are trying
to estimate is called the dependent variable and the other variables on which our
estimates are based are known as independent variables.
r122 r23
2
2r12 r23 r13 r132 r23
2
2r12 r23 r13
R2.13 , R3.12
1 r132 1 r122
Problem:
1. The following zero-order correlation coefficients are given: r12 0.98, r13 0.44 and
r23 = 0.54. Find R1.23 .
r122 r132 2r12 r23 r13
Solution: R1.23
1 r23
2
Regression:
Lines of regression:
1. The line of regression of Y on X is given by y y r. Y ( x x )
X
2. The line of regression of X on Y is given by x x r. X ( y y )
Y
Regression Coefficients:
1. Regression coefficient of Y on X : r. Y bYX
X
( x x )( y y )
Where bYX
2
(x x)
2. Regression coefficient of X on Y : r. X b XY
Y
( x x )( y y )
Where b XY
2
( y y)
Problem:
1. From the following data find (i) two regression equations (ii) the coefficient of
correlation (iii) Find Y when X 30
X 25 28 35 32 31 36 29 38 34 32
Y 43 46 49 41 36 32 31 30 33 39
Solution:
X Y XX Y Y ( X X )2 (Y Y ) 2 (X X )
= X 32 = Y 38 (Y Y )
25 43 -7 5 49 25 -35
28 46 -4 8 16 64 -32
35 49 3 11 9 121 33
32 41 0 3 0 9 0
31 36 -1 -2 1 4 2
36 32 4 -6 16 36 -24
29 31 -3 -7 9 49 21
38 30 6 -8 36 64 -48
34 33 2 -5 4 25 -10
32 39 0 1 0 1 0
320 380 0 0 140 398 -93
X 320 Y 380
Here, X 32 , Y 38
n 10 n 10
Solution:
Since both the lines of regression passes through the mean values x and y , the
point ( x , y ) must satisfy the two given regression lines .
8 x 10 y 66 …………..(1)
40 x 18 y 214 …………..(2)
Practice Problem: