G Statiscis Chapter 8
G Statiscis Chapter 8
G Statiscis Chapter 8
. S. B. Bhattacharjee
Ch 8_1
. S. B. Bhattacharjee
Ch 8_2
. S. B. Bhattacharjee
Ch 8_3
What is Regression?
Regression is a statistical tool to estimate (or predict)
the unknown values of one variable from known values
of another variable.
Example: If we know that advertising and sales are
correlated, we may find out the expected amount of
sales for a given advertising expenditure or the amount
of expenditure for achieving a fixed sales target.
. S. B. Bhattacharjee
Ch 8_4
Ch 8_5
. S. B. Bhattacharjee
Ch 8_6
. S. B. Bhattacharjee
Ch 8_7
. S. B. Bhattacharjee
Ch 8_8
. S. B. Bhattacharjee
Ch 8_9
. S. B. Bhattacharjee
Ch 8_10
Ch 8_11
. S. B. Bhattacharjee
Ch 8_12
Continued
. S. B. Bhattacharjee
Ch 8_13
. S. B. Bhattacharjee
Ch 8_14
Y
X
b
a+
=
b Y
1 UNIT IN X
. S. B. Bhattacharjee
Ch 8_15
. S. B. Bhattacharjee
Ch 8_16
. S. B. Bhattacharjee
Ch 8_17
Continued
. S. B. Bhattacharjee
Ch 8_18
Ye = a+bX)
Or ,
Y a bX 1
Y a bX X 0
Y a bX 0............... 1
Y a bX X 0............ 2
From 1 , we have
1 , Y
a bX
Na b X
From 2 , we have
YX aX bX 2
XY a X b X 2
. S. B. Bhattacharjee
Continued
Ch 8_19
Example:
The following data give the hardness (X) and tensile
strength (Y) of 7 samples of metal in certain units. Find
the linear regression equation of Y on X.
X:
Y:
65
78
77
89
82
85
86
Solution:
Regression equation of Y on X is given by
Y = a+bX
The normal equations are:
Y = Na + bX..
(1)
= aX+
. S. B.XY
Bhattacharjee
bX2
(2) Ch 8_20
Continued
X2
Y2
XY
146
75
21316
5625
10950
152
78
23104
6084
11856
158
77
24964
5929
12166
164
89
26896
7921
14596
170
82
28900
6724
13940
176
85
30976
7225
14960
182
86
33124
7396
15652
1148
(=X)
572
(=Y)
189280
(=X2)
46904
(=Y2)
94120
(=XY)
. S. B. Bhattacharjee
Continued..
Ch 8_21
Here, N = 7
Substituting the values in equations (1) and (2), we
get
572 =7a +1148 b . (5)
94120 = 1148 a +189280 b (4)
Multiplying the equation (3) by 164, we get
93808 =1148 a +188272 b ..(5)
Subtracting this equation from (4), we get
b = 0.31
Putting this value of b in equation (3), we have
. S. B. Bhattacharjee
Continued..
Ch 8_22
572 7a 1148 0 31
572 7 a 355 88
7a 572 355 88
7a 216 12
216 12
a
30 87
7
. S. B. Bhattacharjee
Ch 8_23
Y:
Solution:
X
X2
Y2
XY
25
10
16
64
32
25
49
35
X=15
Y=25
. S. B. Bhattacharjee
X2 = 55
Y2 =151
Continued..
XY = 88
Ch 8_24
. S. B. Bhattacharjee
Ch 8_25
Continued..
Ch 8_26
Y Y b yx X X
b yx
,
2
x
. S. B. Bhattacharjee
y Na b x........... 1
2
xy
a
x
b
x
.... 2
Ch 8_27
b
x
b or b yx
. S. B. Bhattacharjee
xy
2
x
Ch 8_28
. S. B. Bhattacharjee
bxy
2
y
Ch 8_29
Example:
The following data give the hardness (X) and tensile
strength (Y) 7 samples of metal in certain units. Find
the linear regression equation of Y on X.
X:
146 152
Y:
75
77
78
89
82
85
86
Continued..
. S. B. Bhattacharjee
Ch 8_30
Hardness Strength
(X)
(Y)
Y
X(x) X Y (y)
x2
y2
xy
146
75
- 18
- 6.7142
324
45.08
120.86
152
78
- 12
-3.7122
144
13.80
44.57
158
77
-6
- 4.7142
36
22.22
28.29
164
89
7.2858
53.08
170
82
0.2853
36
0.08
1.71
176
85
12
3.2858
144
10.80
39.43
182
86
18
4.2858
324
18.37
77.14
N=7
X=1148 Y=572
. S. B. Bhattacharjee
x=0
y=0
x2=
1008
Continued..
y2
=163.43
xy
=312
Ch 8_31
1148
X
164
7
Y 572
81 71
N
7
xy 312
b yx
0 309 0 31
2
x 1008
Y Y 0 31 X 164
Y 81 71 0 31X 50 84 81 71
Y 0 31X 50 84 81 71
Y 0 31X 30 87
i.c. Y 30 87 0 31X
. S. B. Bhattacharjee
Ch 8_32
. S. B. Bhattacharjee
Ch 8_33
xy
b xy
2
y
Continued..
. S. B. Bhattacharjee
Ch 8_34
bxy
. S. B. Bhattacharjee
N dx dy dx dy
N d y dy
2
Ch 8_35
Ch 8_36
Ch 8_37
a bX
X
Y E e
Y
. S. B. Bhattacharjee
Ch 8_38
. S. B. Bhattacharjee
Ch 8_39
xy
b yx
2
x
. S. B. Bhattacharjee
Continued..
Ch 8_40
b yx
N dxd y dx
. S. B. Bhattacharjee
dy
2
2
N d x d x
Ch 8_41
r would be 1 2 1 4
1 29 which is not possible.
. S. B. Bhattacharjee
Continued
Ch 8_42
If b xy 0 2 and b yx 0 8,
r 0 2 0 8 0 4
. S. B. Bhattacharjee
Continued
Ch 8_43
Example:
If bxy
yx
r
2
0 8 and byx 0 4, the average of
08 0 4
the two values would be
0 6.
2
The value of r would be 0 8 0 4
0 566 which is less than 0 6.
. S. B. Bhattacharjee
Continued
Ch 8_44
. S. B. Bhattacharjee
Ch 8_45
Example:
Prove that the coefficient of correlation is the
geometric mean of the regression coefficient
Proof: Let bxy be co efficient of X on Y and byx be co
efficient of Y on X.
now, bxy
y
x
r.
; bxy r.
y
x
bxy b yx r
y
x
y
x
r2
or , r 2 bxy b yx r bxy b yx
The coefficient of correlation is the geometric mean
of the two regression coefficients.
. S. B. Bhattacharjee
Ch 8_46
N XY X
Y
2
N X 2 X
or
X a
Y b
and v
h
k
X a hu and Y b kv
Let
and
X a hu
Subtracting
and Y b kv
we get
X X h u u
X X Y Y
b yx
.......... i
2
X X
and
Y Y k v v
u u v v k
h u u k v v k
b yx
bvu
2
2
2
h
h
h u u
u u
Similary , it can be shown that bxy
. S. B. Bhattacharjee
h
buv .
k
Ch 8_47
Example:
The following figures relate to advertisement
expenditure and corresponding sales
Advertisement
(in lakhs of Taka)
60
62
65
70
73
75
71
Sales
( in crores of Taka)
10
11
13
15
16
19
14
Estimate
i) The sales for advertisement expenditure of Tk. 80
lakhs and
ii) The advertisement expenditure for a sales target of
Tk. 25 crores
. S. B. Bhattacharjee
Ch 8_48
X X
=x
x2
60
64
62
65
Y Y
=y
y2
xy
10
16
32
36
11
18
13
70
15
73
25
16
10
75
49
19
25
35
71
14
X=476 x= 0 x2=196
. S. B. Bhattacharjee
xy= 100
Ch 8_49
Here,
X
Y 98
476
N 7;
68 and Y
14
N
7
N
7
i Regression equation of Y on X :
Y Y b yx X X ..................(i )
Here,
xy 100
b yx
0 51
2
x 196
Ch 8_50
. S. B. Bhattacharjee
Ch 8_51
X X b xy Y Y
Here,
xy 100
bxy
1 7857 1 79
2
y 56
X 68 1 79 Y 14
X 68 1 79 24 9998
X 1 79Y 24 9998 68
X 1 79Y 43
. S. B. Bhattacharjee
Ch 8_52
Y= 25 croes,
. S. B. Bhattacharjee
Ch 8_53
Example:
The following data relate to advertising expenditure
(in lakhs of Taka) and their corresponding sales (in
crores of Taka):
Advertising Expenditure 10
12
15
23
20
Sales
17
23
25
21
14
. S. B. Bhattacharjee
Ch 8_54
X (x) X
10
-6
36
12
-4
15
Y Y
(y)
y2
xy
14
-6
36
+36
16
17
-3
+12
-1
23
+3
-3
23
+7
49
25
+5
25
+35
20
+4
16
21
+1
+4
X= 80 x= 0
x2=118
. S. B. Bhattacharjee
Y=100
y=0
y2=80 xy=84
Ch 8_55
Here,
X
X
N
80
16
5
Y 100
20
N
XY
b yx
2
X
84
0 712
118
Y 20 0 712 X 16
Y 0 712 X 11.392 20
Y 0 712 X 8 608
. S. B. Bhattacharjee
Ch 8_56
X X bxy Y Y
xy 84
bxy
1 05
2
y 80
. S. B. Bhattacharjee
Ch 8_57
X 16 1 05 Y 20
X 16 1 05Y 21
X 16 21 1 05Y
X 5 1 05Y
. S. B. Bhattacharjee
Ch 8_58
Ch 8_59
S yx
S yx
N 2
Or
2
Y
a Y b YX
. S. B. Bhattacharjee
N 2
Ch 8_60
S xy
S xy
N 2
Or
2
X
a X b xy
N 2
i)
ii )
S xy S y 1 r 2
S yx S x 1 r
. S. B. Bhattacharjee
2
Continued.
Ch 8_61
Ch 8_62
Total variation in Y
Error sum of squares
2
R 1
Total sum of squares
. S. B. Bhattacharjee
Continued.
Ch 8_63
. S. B. Bhattacharjee
Ch 8_64
. S. B. Bhattacharjee
Ch 8_65