24-02-2023
Regression
Analysis
(Part 1)
Basics Concepts
Least Square Method
Linear Regression
Y = a + bX & X = a + bY
Biostatistics & Research Methodology
B Pharm 8th Sem | M. Pharm. | PhD
Regression
Correlation analysis established the relationship between two or more variables
Now with the help of regression analysis we estimate or predict the value of one
variable given the value of the another
SN Over Runs
Runs
350
300
1 10 60
250
2 20 130
200
RUNS
3 30 220
150 Runs
4 40 280
100
5 50
50
0
0 10 20 30 40 50 60
OVERS
1
24-02-2023
Regression
Regression analysis established the average relationship between two or more
variables and helps to estimation or prediction
Y = mx ± c
m- Slope
C – Y-intercept
450
400 y = 8.8x - 40
R² = 0.9308
350
300
250
RUNS
200
150
100
50
0
0 10 20 30 40 50 60
OVERS
Regression
450
X-Axis (Overs) 400
y = 8.8x - 40
R² = 0.9308
350
Independent/Explanatory/Predictor/RegratorVariable 300
Used to prediction the variable of interest 250
RUNS
200
Y-Axis (Runs) 150
100
dependent or Explained Variable 50
0
It is predicted by Explanatory Variable 0 10 20 30 40 50 60
OVERS
Analysis
Simple Linear Regression Analysis
Regression equation of Y on X- Y = a + bx
a- constant (y-intercept)
b- Slop of the regression line, indicate the changes in Y
variable for a unit changes in X variable
2
24-02-2023
Regression
450
Simple Linear Regression Analysis Method- 400
y = 8.8x - 40
R² = 0.9308
350
Regression equation of Y on X- Y = a + bx
300
Least Squares method 250
RUNS
200
σ 𝑦 − 𝑦𝑐 2 =0 150
100
For determination a and b 50
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑥
0
0 10 20 30 40 50 60
OVERS
σ 𝑋𝑌 = 𝑎𝛴𝑥 + 𝑏𝛴𝑥 2
Regression
Suppose Y is independent and X is dependent SN Over Runs
Y-Axis (Runs)
1 10 60
Independent or Explanatory Variable
2 20 130
Used to prediction the variable of interest
3 30 220
X-Axis (Over) 4 40 280
dependent or Explained Variable 5 320
It is predicted by Explanatory Variable
Analysis
Simple Linear Regression Analysis
Regression equation of X on Y- X = a + By
𝛴𝑋 = 𝑁𝑎 + 𝑏 σ 𝑌
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴𝑌 2
3
24-02-2023
Regression
𝛴𝑋 = 𝑁𝑎 + 𝑏 σ 𝑌
Simple Linear Regression Analysis Method-
100 = 4a + b690
Regression equation of X on Y- =X = a + bY
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴𝑌 2
𝛴𝑋 = 𝑁𝑎 + 𝑏 σ 𝑌 2100 = a690 + b147300
(100 = 4a + b690) x 172.5 ------1
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴𝑌 2
21000 = a690 + b147300 ------2
X = a + bY
X = 2.57 + 0.13Y
17250 = 690a + b119025
X = 2.57 + 0.13 x 320
S Over Runs XY X2 Y2 21000 = a690 + b147300
X = 2.57 + 41.6
N (X) (Y) -----------------------------------------
X = 44.17
1 10 60 600 100 3600 -3750 = -28275b
2 20 130 2600 400 16900 b = 3750/28275 = 0.13
3 30 220 6600 900 48400 100 = 4a + 0.13x690
100 = 4a + 89.7
4 40 280 11200 1600 78400
a = 10.3/4 = 2.57
100 690 21000 3000 147300
Regression
Simple Linear Regression Analysis Method- 15 = 5a + b30 ------1 Y = a + bX
Regression equation of Y on X- Y = a + bx 110 = a30 + b220 ------2 Y = 0 + 0.5X
Y = 0.5 X 12
For determination a and b
(15 = 5a + b30 ) x6 Y=6
𝛴𝑦 = 𝑁𝑎 + 𝑏 σ 𝑥
110 = a30 + b220
σ 𝑥𝑦 = 𝑎𝛴𝑥 + 𝑏𝛴𝑥 2
S Conc. Abs (Y) XY X2 Y2 90 = 30a + 180b
N (X)
110 = 30a + 220b
1 2 1 2 4 1 -----------------------------------------
2 4 2 8 16 4 -20 = -40b
3 6 3 18 36 9 b = 20/40 = 0.5
4 8 4 32 64 16 15 = 5a + 0.5 x 30
5 10 5 50 100 25 15 = 5a + 15
30 15 110 220 55 a = 0/5 = 0
4
24-02-2023
Regression
Analysis
(Part 2)
Multiple Regression
Biostatistics & Research Methodology
B Pharm 8th Sem | M. Pharm. | PhD
Regression
Regression analysis helps to estimate or predict the value of one variable given the
value of the another
Prediction the value of one dependent variable by available multiple independent
variable.
SN Y (Marks) X (Study hour) S Y X (Study X2 (Class)
1 2 3 N (Marks) hour)
2 4 4 1 2 3 2
3 6 6 2 4 4 3
4 8 7 3 6 6 4
5 10 9 4 8 7 5
5 10 9 6
Y on X, Y = a + bx
Y on X1 & X2
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑥 Y = a + b1x1 + b2X2
σ 𝑋𝑌 = 𝑎𝛴𝑥 + 𝑏𝛴𝑥 2
5
24-02-2023
Regression
The model should be relevant and reliable
The model should be linear, and variables must have normal distribution
The purpose of the constant “a” is denote the dependent variable value in case
when the values of independent variable turn to zero
S Y X (Study X2 (Class) Y on X1 & X2 Y = a + b1x1 + b2X2
N (Marks) hour)
1 2 3 2
1. ΣY = Na + b1 σ X1 + b2 σ X2
2 4 4 3 2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2
3 6 6 4
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
4 8 7 5
5 10 9 6
Regression
SN Y (Marks) X1 (Study X2 (Class) YX1 YX2 X1X2 Y2 X12 X22
hour)
1 2 3 2 6 4 6 4 9 4
2 4 4 3 16 12 12 16 16 9
3 6 6 4 36 24 24 36 36 16
4 8 7 5 56 40 35 64 49 25
5 10 9 6 90 60 54 100 81 36
30 29 20 204 140 131 191 90
Y on X1 & X2 Y = a + b1x1 + b2X2
1. ΣY = Na + b1 σ X1 + b2 σ X2
2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
6
24-02-2023
Regression
S Y X1 X2 YX1 YX2 X1X Y2 X12 X22 30 = 5a + 29b1 + 20b2 --------------------1
N (M (Stu (Cla 2
ark dy ss) 204 = 29a + 191b1 + 131b2 --------------------2
s) hou 140 = 20a + 131b1 + 90b2 ------------------3
r)
1 2 3 2 6 4 6 4 9 4 Solve the equation 1 & 2
2 4 4 3 16 12 12 16 16 9 (30 = 5a + 29b1 + 20b2 ) x 5.8
3 6 6 4 36 24 24 36 36 16 204 = 29a + 191b1 + 131b2
4 8 7 5 56 40 35 64 49 25 174 = 29a + 168.2 b1 + 116 b2
5 10 9 6 90 60 54 100 81 36 204 = 29a + 191b1 + 131b2
30 29 20 204 140 131 191 90 -------------------------------------------
1. ΣY = Na + b1 σ X1 + b2 σ X2 -30 = -21.8 b1 -15 b2
2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2 30 = 21.8 b1 + 15 b2--------------------4
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
Regression
S Y X1 X2 YX1 YX2 X1X Y2 X12 X22 30 = 5a + 29b1 + 20b2 --------------------1
N (M (Stu (Cla 2
ark dy ss) 204 = 29a + 191b1 + 131b2 --------------------2
s) hou
r) 140 = 20a + 131b1 + 90b2 ------------------3
1 2 3 2 6 4 6 4 9 4 Solve the equation 1 & 3
2 4 4 3 16 12 12 16 16 9 (30 = 5a + 29b1 + 20b2 ) x 4
3 6 6 4 36 24 24 36 36 16 140 = 20a + 131b1 + 90b2
4 8 7 5 56 40 35 64 49 25 120 = 20a + 116 b1 + 80 b2
5 10 9 6 90 60 54 100 81 36 140 = 20a + 131b1 + 90b2
30 29 20 204 140 131 191 90 -------------------------------------------
1. ΣY = Na + b1 σ X1 + b2 σ X2 -20 = -15 b1 -10 b2
2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2 20 = 15 b1 + 10 b2--------------------5
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
7
24-02-2023
Regression
S Y X1 X2 YX1 YX2 X1X Y2 X12 X22 30 = 5a + 29b1 + 20b2 --------------------1
N (M (Stu (Cla 2
ark dy ss) 204 = 29a + 191b1 + 131b2 --------------------2
s) hou
r) 140 = 20a + 131b1 + 90b2 ------------------3
1 2 3 2 6 4 6 4 9 4 Solve the equation 4 & 5
2 4 4 3 16 12 12 16 16 9 (30 = 21.8 b1 + 15b2 ) x 2
3 6 6 4 36 24 24 36 36 16 (20 = 15 b1 + 10 b2) x 3
4 8 7 5 56 40 35 64 49 25 60 = 43.6b1 + 30b2
5 10 9 6 90 60 54 100 81 36 60 = 45b1 + 30b2
30 29 20 204 140 131 191 90 -----------------------
1. ΣY = Na + b1 σ X1 + b2 σ X2 0 = -1.4b1 the b1 = 0
2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2 From eq 5
20 = 15 b1 + 10 b2
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
20 = 0 + 10b2 then b2 =2
Regression
S Y X1 X2 YX1 YX2 X1X Y2 X12 X22 30 = 5a + 29b1 + 20b2 --------------------1
N (M (Stu (Cla 2
ark dy ss) 204 = 29a + 191b1 + 131b2 --------------------2
s) hou
r) 140 = 20a + 131b1 + 90b2 ------------------3
1 2 3 2 6 4 6 4 9 4 b1 = 0
2 4 4 3 16 12 12 16 16 9 B2 = 2
3 6 6 4 36 24 24 36 36 16 From eq 1
4 8 7 5 56 40 35 64 49 25 30 = 5a + 29 x 0 + 20 x 2
5 10 9 6 90 60 54 100 81 36 30 = 5a +40
30 29 20 204 140 131 191 90 -10/5 = a
1. ΣY = Na + b1 σ X1 + b2 σ X2 a = -2
2. ΣYX1 = aΣX1 + b1 σ X2 1 + b2 σ X 1 X2 So finally Y = a + b1x1 + b2X2
Y = -2 + 2X2
3. ΣYX2 = aΣX2 + b1 σ X 1 X2 + b2 σ X2 2
Y = 2X2 - 2
8
24-02-2023
Regression
Analysis
(Part 3)
Standard Error of
Regression
Biostatistics & Research Methodology
B Pharm 8th Sem | M. Pharm. | PhD
Standard Error of Regression
Estimate the deviation from actual value of variables ( X or Y)
SN X Y X2 Y2 XY
1 2 3
2 4 4
3 5 8
4 7 9
5 8 10
26 34
Y on X, Y = a + bx
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑋
σ 𝑋𝑌 = 𝑎𝛴𝑋 + 𝑏𝛴𝑋 2
X on Y, X = a + bY
𝛴𝑋 = 𝑁𝑎 + 𝑏 σ 𝑌
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴Y 2
9
24-02-2023
Standard Error of Regression
Estimate the deviation from actual value of variable
SN X Y X2 Y2 XY Y on X, Y = a + bx
1 2 3 4 9 6
(34 = 5a + 26b) x 5.2-----------------1
205 = 26a + 158b-----------2
2 4 4 16 16 16
3 5 8 25 64 40
From eq 1 & 2
4 7 9 49 81 63 176.8 = 26a + 135.2b
5 8 10 64 100 80 205 = 26a + 158b
26 34 158 270 205 -------------------------------
Y on X, Y = a + bx -28.2 = -22.8b
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑋 b = 28.2/22.8 = 1.2
σ 𝑋𝑌 = 𝑎𝛴𝑋 + 𝑏𝛴𝑋 2 From eq 1
X on Y, X = a + bY 34 = 5a + 26b
34 = 5a + 31.2
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑌
2.8/5 = a = 0.56
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴Y 2
Y = 0.56 + 1.2X
Standard Error of Regression
Estimate the deviation from actual value of variable 𝟐 𝟐
𝒀−𝒀𝒄 𝑿−𝑿𝒄
SN X Y Yc Y-Yc (Y-Yc)2 Y = 0.56 + 1.2X Syx= Sxy= 𝑵
𝑵
1 2 3 2.96 0.04 0.0016
2 4 4 5.36 -1.36 1.84 𝟑.𝟗𝟑
Syx=
3 5 8 6.56 1.44 2.07 𝟓
4 7 9 8.96 0.04 0.0016 Syx= 𝟎. 𝟕𝟖
5 8 10 10.16 -0.16 0.02
26 34 3.39 Syx = 0.88
Y on X, Y = a + bx
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑋
σ 𝑋𝑌 = 𝑎𝛴𝑋 + 𝑏𝛴𝑋 2
X on Y, X = a + bY
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑌
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴Y 2
10
24-02-2023
Standard Error of Regression
Estimate the deviation from actual value of variable
SN X Y X2 Y2 XY X on Y, X = a + bY
1 2 3 4 9 6 (26 = 5a + 34b) x 6.8-----------------1
2 4 4 16 16 16
205 = 34a + 270b-----------2
3 5 8 25 64 40
From eq 1 & 2
4 7 9 49 81 63
176.8 = 34a + 231b
5 8 10 64 100 80 205 = 34a + 270b
26 34 158 270 205 --------------------------------
Y on X, Y = a + bx -28.2 = -39b
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑋 b = 28.2/39 = 0.72
σ 𝑋𝑌 = 𝑎𝛴𝑋 + 𝑏𝛴𝑋 2
From eq 1
X on Y, X = a + bY 26 = 5a + 34b
𝛴𝑋 = 𝑁𝑎 + 𝑏 σ 𝑌 26 = 5a + 24.5
1.5/5 = a = 0.3
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴Y 2
X = 0.3 + 0.72X
Standard Error of Regression
Estimate the deviation from actual value of variable 𝟐 𝟐
𝛴 𝒀−𝒀𝒄 𝛴 𝑿−𝑿𝒄
SN X Y Xc X-Xc (X-Xc)2 X = 0.3 + 0.72Y Syx= Sxy= 𝑵
𝑵
1 2 3 2.46 -0.46 0.21
2 4 4 3.2 0.8 0.64 𝟐.𝟏𝟒
Sxy=
3 5 8 6 -1 1 𝟓
4 7 9 6.8 0.2 0.04 Sxy= 𝟎. 𝟒𝟑
5 8 10 7.5 0.5 0.25
26 34 2.14 Sxy = 0.65
Y on X, Y = a + bx
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑋
σ 𝑋𝑌 = 𝑎𝛴𝑋 + 𝑏𝛴𝑋 2
X on Y, X = a + bY
𝛴𝑌 = 𝑁𝑎 + 𝑏 σ 𝑌
σ 𝑋𝑌 = 𝑎𝛴𝑌 + 𝑏𝛴Y 2
11
24-02-2023
Thanks for Watching
Subscribe my YouTube
Channel
12