SlideShare a Scribd company logo
1 of 23
SIMPLE LINEAR REGRESSION
PREPARED BY
HASSAN SHEHWAR SHAH
DEPARTMENT OF MECHANICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY
TAXILA
3/16/2021 1
OUTLINES
๏‚ง Introduction of linear regression
๏‚ง Simple linear regression Definition
๏‚ง Simple linear Regression Model
๏‚ง Assumption of Simple linear Regression
๏‚ง Formulas for Estimate Regression Line
๏‚ง Example
3/16/2021 2
Department of Mechanical Engineering
INTRODUCTION TO LINEAR REGRESSION
๏‚ง Linear Regression Is Used To:
โ€’ Predict The Value Of A Dependent Variable Based On The Value Of At Least One
Independent Variable
โ€’ Explain The Impact Of Change In An Independent Variable On The Dependent
Variable
Dependent Variable : The variable we wish to predict or explain
Independent Variable : The variable used to explain the dependent variable
3/16/2021 3
Department of Mechanical Engineering
SIMPLE LINEAR REGRESSION MODEL
๏‚ง Only One Independent Variable, X
๏‚ง Relationship Between X And Y Is Described By A Linear Function
๏‚ง Changes in Y Are Assumed To Be Caused By Changes in X
3/16/2021 4
Department of Mechanical Engineering
SIMPLE LINEAR REGRESSION MODEL
Yi = ฮฒ0 + ฮฒ1Xi + ิi
๏‚ง This is also known as Population Regression Model (PRM)
Where Yi Dependent Variable or observation randomly drawn from Population
Xi Independent variable or fixed
ิi Random error or Residual
ฮฒ0 & ฮฒ1 Population Parameters
ฮฒ0 is Intercept ฮฒ1 Slope or Regression Coefficient
3/16/2021 5
Department of Mechanical Engineering
SIMPLE LINEAR REGRESSION MODEL
3/16/2021 6
Y
Observed Value
of Y for Xi
ฮตi
Slope = ฮฒ1
Predicted Value
of Y for Xi
Random Error
for this Xi value
Intercept = ฮฒ0
Xi
Yi = ฮฒ0 + ฮฒ1Xi
X
Department of Mechanical Engineering
TYPES OF RELATIONSHIPS
Y
X
Y
X
Y
Y
X
X
Strong relationships Weak relationships
3/16/2021 7
Department of Mechanical Engineering
ASSUMPTION OF SIMPLE LINEAR REGRESSION
3/16/2021 8
โ€ข The simple linear Regression model is linear parameters.
โ€ข The Independent variable X values are non random.
โ€ข The residual (error) term has zero mean or the expected value of error term is zero.
โ€ข The residual (error) values follow the normal distribution
โ€ข There is no relationship between residual (error) term and X variable
Department of Mechanical Engineering
ESTIMATE REGRESSION MODEL
๏‚ง Let there be a set of observations (Xi, Yi) , i = 1,2,3-----n,
Yi = ฮฒ0 + ฮฒ1Xi + ิi
In terms of sample data
Yi = b0 + b1Xi + ei
Where โ€œb0โ€ and โ€œb1โ€ are least square estimate of ฮฒ0 and ฮฒ1 and ei commonly called
Residual.
3/16/2021 9
Department of Mechanical Engineering
FORMULA FOR ESTIMATION REGRESSION LINE
โ€ข The least square estimates are as under
b1 =
๐‘‹๐‘–
๐‘Œ๐‘–
โˆ’๐‘›๐‘‹Y
๐‘‹๐‘–
2
โˆ’๐‘›๐‘‹2 (1)
b0 = Yฬ… - b1Xฬ… (2)
Where Xฬ… =
๐‘‹๐‘–
๐‘›
& Yฬ… =
๐‘Œ๐‘–
๐‘›
the parameters b0 and b1 can also be expressed in terms of sums of squares as
follows:
b1 =
๐‘†๐‘†๐‘‹๐‘Œ
๐‘†๐‘†๐‘‹
(3)
b0 = Yฬ… - b1Xฬ… (4)
3/16/2021 10
Department of Mechanical Engineering
FORMULA FOR ESTIMATION REGRESSION LINE
SSx = ( ๐‘‹๐‘– โˆ’ Xฬ„)2 = ๐‘‹๐‘–
2 โˆ’ ๐‘›Xฬ„ (5)
SSY = (๐‘Œ๐‘– โˆ’ Yฬ„)2 = ๐‘Œ๐‘–
2 โˆ’ ๐‘›Yฬ„ (6)
SSxy = (๐‘‹๐‘– โˆ’ Xฬ„)(Y๐‘– โˆ’ Yฬ„) = ๐‘‹๐‘–๐‘Œ๐‘– โˆ’
( Xi
)( Yi
)
n
(7)
๏‚ง SSX and SSY are the terms used to determine the variance of X and variance of Y
respectively. SSX and SSY are called corrected sum of squares. And ๊žต1 and ๊žต0 are
estimated as follows:
๊žต1 =
๐‘†๐‘†๐‘‹๐‘Œ
๐‘†๐‘†๐‘‹
(8)
๊žต0 = Yฬ… - ๊žต1Xฬ… (9)
Y = ๊žต0 + ๊žต1x is the regression equation (10)
Variance of X(Sx
2) = SSx/(n-1) and (11)
Variance of Y(Sx
2) = SSY/(n-1) (12)
3/16/2021 11
Department of Mechanical Engineering
STANDARD ERROR AND ANOVA EQUATION
โ€ข Similarly, we can write error sum of squares (SSe) for the regression as
SSe = ๐‘’๐‘–
2 and Standard error as Se =
๐‘’๐‘–
2
๐‘›โˆ’2
=
๐‘†๐‘†๐‘’
๐‘‘๐‘“๐‘’
where, dfe are error degree of freedom
๏‚ง The ANOVA equation for linear regression is
Total corrected sum of square = sum of squares due to regression + sum of square
due to error
SSTotal = SSR + SSe
๏‚ง The sum of squares are computed as follows:
Let CF (Corrected factor) =
๐บ๐‘Ÿ๐‘Ž๐‘›๐‘‘ ๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™ 2
๐‘๐‘ข๐‘š๐‘๐‘’๐‘Ÿ ๐‘œ๐‘“ ๐‘‚๐‘๐‘’๐‘Ÿ๐‘ฃ๐‘Ž๐‘ก๐‘–๐‘œ๐‘›
SSTotal = ๐‘Œ๐‘–
2 โˆ’
( ๐‘Œ๐‘–
)2
๐‘›
= ๐‘Œ๐‘–
2 โˆ’ CF (13)
SSR = ๊žต1SSXY (14)
3/16/2021 12
Department of Mechanical Engineering
ANVOVA TABLE FOR SIMPLE LINEAR
REGRESSION AND F-TEST
Source Sum of Square Degree of Freedom Mean square F0
Regression SSR= ๊žต1SSXY
1 MSR=
SSR
1
๐‘€๐‘†๐‘…
๐‘€๐‘†๐‘’
Error SSe = SSTotal- SSR n-2 MSe =
SSe
(๐‘›โˆ’2)
Total SSTotal = SSY n-1
3/16/2021 13
๏‚ง Test for significance of regression is to determine if there is a linear relationship between X
and Y.
The appropriate hypotheses are H0 : ๊žต1 = 0
H1 : ๊žต1 โ‰  0
Reject H0 if F0 exceeds Fฮฑ,1,n-2
Rejection of H0 implies that there is significant relationship between the variable X and Y. we can
also test the coefficients ๊žต0 and ๊žต1 using t test with n โ€“ 2 degrees of freedom.
Department of Mechanical Engineering
T-TEST FOR ๊žต0 AND ๊žต1
โ€ข The hypotheses are
H0 : ๊žต0 = 0
H1 : ๊žต0 โ‰  0
And H0 : ๊žต1 = 0
H1 : ๊žต1 โ‰  0
๏‚ง The test statistics for Intercept t0 =
๊žต0
๐‘€๐‘†๐‘’
(
1
๐‘›
+
Xฬ…2
๐‘†๐‘†๐‘‹
)
(15)
Reject H0, if |t0| > tฮฑ/2,nโ€“2
๏‚ง The test statistics for Slope t0 =
๊žต1
๐‘€๐‘†๐‘’/๐‘†๐‘†๐‘‹
(16)
Reject H0, if |t0| > tฮฑ/2,nโ€“2
3/16/2021 14
Department of Mechanical Engineering
COEFFICIENT OF DETERMINATION (R2)
โ€ข The coefficient of determination is
R2 =
๐‘†๐‘†๐‘…
๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™
= 1 โˆ’
๐‘†๐‘†๐‘’
๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™
(17)
๏‚ง The value of R2 lie between 0 and 1.
๏‚ง The higher R2 the greater the percentage of the variation of explained by the
regression plain that is the better the goodness of fit of the regression plain to the
sample observations.
๏‚ง The closer R2 to zero the worse the fit.
3/16/2021 15
Department of Mechanical Engineering
CONFIDENCE INTERVALS ON THE SLOPE AND
INTERCEPT
๏‚ง A 100(1 โˆ’ ฮฑ)% confidence interval on the slope ฮฒ1 in simple linear
regression is
ฮฒ1 ยฑ ta/2, n-2
๐‘€๐‘†๐‘’
๐‘†๐‘†๐‘‹
(18)
๏‚ง Similarly, a 100(1โˆ’ ฮฑ)% confidence interval on the intercept ฮฒ0 is
ฮ’0 ยฑ ta/2, n-2 ๐‘€๐‘†๐‘’(
1
๐‘›
+
Xฬ„
๐‘†๐‘†๐‘‹
) (19)
๏‚ง A100(1โˆ’ ฮฑ)% prediction interval on a future observation Y0 at the value X0 is
given by
Y0 ยฑ tฮฑ/2, n-2 ๐‘€๐‘†๐‘’[1 +
1
๐‘›
+
๐‘‹0
โˆ’Xฬ„ 2
๐‘†๐‘†๐‘‹
] (20)
3/16/2021 16
Department of Mechanical Engineering
EXAMPLE SIMPLE LINEAR REGRESSION
A software company wants to find out whether their profit is related to the investment made in
their research and development. They have collected the following data from their company
records.
i. Develop a simple linear regression model to
the data and estimate the profit when the
investment is 13 Lakh rupees.
i. Test the significance of regression using F-test.
ii. Test significance of ๊žต1.
3/16/2021 17
Sr. No. Investment in R&D ( in Lakhs) Annual Profit ( in LakhS)
1 2 24
2 3 25
3 4 31
4 5 34
5 11 40
6 3 31
7 10 36
8 8.5 36
9 4 29
10 6.5 33
11 8 37
12 9.5 37
13 11.5 39
14 10.5 39
15 9.5 36
Department of Mechanical Engineering
SOLUTION EXAMPLE
๏‚ง In this problem, the profit depends on investment on R&D. Hence, X = Investment in
R&D and Y = Profit
3/16/2021 18
Xฬ… =
๐‘‹๐‘–
๐‘›
=
106
15
= 7.067
Yฬ… =
๐‘Œ๐‘–
๐‘›
=
507
15
= 33.8
SSx= (๐‘‹๐‘– โˆ’Xฬ…)2= ๐‘‹๐‘–
2 โˆ’ nXฬ„2 = 901.5 -
15((7.067)2)=152.363
SSY = (๐‘Œ๐‘– โˆ’ Yฬ„)2 = ๐‘Œ๐‘–
2 โˆ’ nYฬ„2= 17477-15((33.8)2) =
340.4
SSXY= (๐‘‹๐‘–๐‘Œ๐‘–) โˆ’ ( ๐‘‹๐‘–)( ๐‘Œ๐‘–)/๐‘› = 3794 โˆ’
106 507
15
= 211.2
Sr. No. X Y XY X2
Y2
1 2 24 48 4 576
2 3 25 75 9 625
3 4 31 124 16 961
4 5 34 170 25 1156
5 11 40 440 121 1600
6 3 31 93 9 961
7 10 36 360 100 1296
8 8.5 36 306 72.25 1296
9 4 29 116 16 841
10 6.5 33 214.5 42.25 1089
11 8 37 296 64 1369
12 9.5 37 351.5 90.25 1369
13 11.5 39 448.5 132.3 1521
14 10.5 39 409.5 110.3 1521
15 9.5 36 342 90.25 1296
Total 106 507 3794 901.5 17477
Department of Mechanical Engineering
SOLUTION OF EXAMPLE CONTINUE..
๊žต1=SSXY/SSX =
211.2
152.363
= 1.386
๊žต0=Yฬ„ - ๊žต1Xฬ… = 33.8 โ€“ 1.386(7.067) = 24.004
The Regression Model Equation Y = ๊žต0 +๊žต1X
Y = 24.004 + 1.386X
(i) When the investment is 13 Lakhs, the profit Y = 24.004 + 1.386(13)
=42.022 lakh
(ii) SSTotal = SSY = 340.4
SSR = ๊žต1*SSXY = (1.386)(211.2) = 292.723
SSe = SSTotal โ€“ SSR =340.4 โ€“ 292.723 = 47.677
3/16/2021 19
Department of Mechanical Engineering
EXAMPLE SOLUTION CONTINUEโ€ฆ
ANOVA TABLE FOR SIMPLE LINEAR REGRESSION
๏‚ง Since F5%,1,13 = 4.67, regression is significant. That is the relation between X and Y
is significant.
3/16/2021 20
Source Sum of Square
Degree of
Freedom
Mean Square F0
Regression SSR=292.723 1 MSR=292.723
79.816
Error Sse=47.677 13 MSe=3.667
Total SSTotal 340.4 14
Department of Mechanical Engineering
EXAMPLE SOLUTION CONTINUEโ€ฆ
T-TEST FOR ๊žต1
The statistic to test the regression coefficient ๊žต1 is
t0 =
๊žต1
๐‘€๐‘†๐‘’
/๐‘†๐‘†๐‘‹
=
1.386
3.667
152.363
= 8.934
Since t0.025,13 = 2.160 the regression coefficient ๊žต1 is significant.
3/16/2021 21
Department of Mechanical Engineering
COEFFICIENT OF DETERMINATION R-SQUARE
๏‚ง For this we have the following formula
R2 =
๐‘†๐‘†๐‘…
๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™
=
292.723
340.4
= 0.85994
๏‚ง This mean that 85.994% change in the dependent variable occurred due to the
given explanatory variable, while rest of 14.006% may be caused by random error.
3/16/2021 22
Department of Mechanical Engineering
SIMPLE LINEAR REGRESSION
๏‚ง The coefficients ๊žต0 & ๊žต1 and all other Regression result can also find from MS
Excel.
3/16/2021 23
Department of Mechanical Engineering

More Related Content

What's hot

Multiple regression (1)
Multiple regression (1)Multiple regression (1)
Multiple regression (1)Shakeel Nouman
ย 
Regression
RegressionRegression
RegressionLavanyaK75
ย 
Linear regression without tears
Linear regression without tearsLinear regression without tears
Linear regression without tearsAnkit Sharma
ย 
Regression analysis in excel
Regression analysis in excelRegression analysis in excel
Regression analysis in excelThilina Rathnayaka
ย 
ML - Simple Linear Regression
ML - Simple Linear RegressionML - Simple Linear Regression
ML - Simple Linear RegressionAndrew Ferlitsch
ย 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression modelsStephen Ong
ย 
2.1 regression
2.1 regression2.1 regression
2.1 regressionManish Gupta
ย 
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierRegression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierAl Arizmendez
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression AnalysisShiela Vinarao
ย 
Simple regression and correlation
Simple regression and correlationSimple regression and correlation
Simple regression and correlationMary Grace
ย 
Regression
Regression Regression
Regression Ali Raza
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysisjamuga gitulho
ย 
Linear regression
Linear regressionLinear regression
Linear regressionSreerajVA
ย 
Presentasi Tentang Regresi Linear
Presentasi Tentang Regresi LinearPresentasi Tentang Regresi Linear
Presentasi Tentang Regresi Lineardessybudiyanti
ย 
161783709 chapter-04-answers
161783709 chapter-04-answers161783709 chapter-04-answers
161783709 chapter-04-answersFiras Husseini
ย 
Regression analysis by Muthama JM
Regression analysis by Muthama JMRegression analysis by Muthama JM
Regression analysis by Muthama JMJapheth Muthama
ย 
Chap11 simple regression
Chap11 simple regressionChap11 simple regression
Chap11 simple regressionJudianto Nugroho
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysisnadiazaheer
ย 

What's hot (20)

Multiple regression (1)
Multiple regression (1)Multiple regression (1)
Multiple regression (1)
ย 
Regression
RegressionRegression
Regression
ย 
Linear regression without tears
Linear regression without tearsLinear regression without tears
Linear regression without tears
ย 
Regression analysis in excel
Regression analysis in excelRegression analysis in excel
Regression analysis in excel
ย 
Malhotra17
Malhotra17Malhotra17
Malhotra17
ย 
ML - Simple Linear Regression
ML - Simple Linear RegressionML - Simple Linear Regression
ML - Simple Linear Regression
ย 
Tbs910 regression models
Tbs910 regression modelsTbs910 regression models
Tbs910 regression models
ย 
2.1 regression
2.1 regression2.1 regression
2.1 regression
ย 
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn LottierRegression Analysis presentation by Al Arizmendez and Cathryn Lottier
Regression Analysis presentation by Al Arizmendez and Cathryn Lottier
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
ย 
Simple regression and correlation
Simple regression and correlationSimple regression and correlation
Simple regression and correlation
ย 
Regression
Regression Regression
Regression
ย 
Mathematical modeling
Mathematical modelingMathematical modeling
Mathematical modeling
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
ย 
Linear regression
Linear regressionLinear regression
Linear regression
ย 
Presentasi Tentang Regresi Linear
Presentasi Tentang Regresi LinearPresentasi Tentang Regresi Linear
Presentasi Tentang Regresi Linear
ย 
161783709 chapter-04-answers
161783709 chapter-04-answers161783709 chapter-04-answers
161783709 chapter-04-answers
ย 
Regression analysis by Muthama JM
Regression analysis by Muthama JMRegression analysis by Muthama JM
Regression analysis by Muthama JM
ย 
Chap11 simple regression
Chap11 simple regressionChap11 simple regression
Chap11 simple regression
ย 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
ย 

Similar to 20 ms-me-amd-06 (simple linear regression)

Bba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsBba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsStephen Ong
ย 
Linear regression
Linear regressionLinear regression
Linear regressionvermaumeshverma
ย 
Rsh qam11 ch04 ge
Rsh qam11 ch04 geRsh qam11 ch04 ge
Rsh qam11 ch04 geFiras Husseini
ย 
CH-VI Regression and Correlation.pptx
CH-VI Regression and Correlation.pptxCH-VI Regression and Correlation.pptx
CH-VI Regression and Correlation.pptxOliyadKondala
ย 
Regression analysis
Regression analysisRegression analysis
Regression analysisAvijit Famous
ย 
Kk2518251830
Kk2518251830Kk2518251830
Kk2518251830IJERA Editor
ย 
Kk2518251830
Kk2518251830Kk2518251830
Kk2518251830IJERA Editor
ย 
Advanced mathematical analysis of chassis integrated platform designed for un...
Advanced mathematical analysis of chassis integrated platform designed for un...Advanced mathematical analysis of chassis integrated platform designed for un...
Advanced mathematical analysis of chassis integrated platform designed for un...Dr.Vikas Deulgaonkar
ย 
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...IJERA Editor
ย 
D040101030040
D040101030040D040101030040
D040101030040ijceronline
ย 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptxMdRokonMia1
ย 
Simple linear regression and correlation
Simple linear regression and correlationSimple linear regression and correlation
Simple linear regression and correlationShakeel Nouman
ย 
Lecture 05 - Statistical Analysis of Experimental Data.pptx
Lecture 05 - Statistical Analysis of Experimental Data.pptxLecture 05 - Statistical Analysis of Experimental Data.pptx
Lecture 05 - Statistical Analysis of Experimental Data.pptxAdelAbdelmaboud
ย 
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...RekhaChoudhary24
ย 
Correlation by Neeraj Bhandari ( Surkhet.Nepal )
Correlation by Neeraj Bhandari ( Surkhet.Nepal )Correlation by Neeraj Bhandari ( Surkhet.Nepal )
Correlation by Neeraj Bhandari ( Surkhet.Nepal )Neeraj Bhandari
ย 
Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2AbdelmonsifFadl
ย 

Similar to 20 ms-me-amd-06 (simple linear regression) (20)

Bba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression modelsBba 3274 qm week 6 part 1 regression models
Bba 3274 qm week 6 part 1 regression models
ย 
Linear regression
Linear regressionLinear regression
Linear regression
ย 
Rsh qam11 ch04 ge
Rsh qam11 ch04 geRsh qam11 ch04 ge
Rsh qam11 ch04 ge
ย 
metod linearne regresije
 metod linearne  regresije metod linearne  regresije
metod linearne regresije
ย 
CH-VI Regression and Correlation.pptx
CH-VI Regression and Correlation.pptxCH-VI Regression and Correlation.pptx
CH-VI Regression and Correlation.pptx
ย 
Regression analysis
Regression analysisRegression analysis
Regression analysis
ย 
Kk2518251830
Kk2518251830Kk2518251830
Kk2518251830
ย 
Kk2518251830
Kk2518251830Kk2518251830
Kk2518251830
ย 
Advanced mathematical analysis of chassis integrated platform designed for un...
Advanced mathematical analysis of chassis integrated platform designed for un...Advanced mathematical analysis of chassis integrated platform designed for un...
Advanced mathematical analysis of chassis integrated platform designed for un...
ย 
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...
Pwm Control Strategy for Controlling Of Parallel Rectifiers In Single Phase T...
ย 
Regression
RegressionRegression
Regression
ย 
D040101030040
D040101030040D040101030040
D040101030040
ย 
Regression Analysis.pptx
Regression Analysis.pptxRegression Analysis.pptx
Regression Analysis.pptx
ย 
Simple linear regression and correlation
Simple linear regression and correlationSimple linear regression and correlation
Simple linear regression and correlation
ย 
New name-400-4
New name-400-4New name-400-4
New name-400-4
ย 
Lecture 05 - Statistical Analysis of Experimental Data.pptx
Lecture 05 - Statistical Analysis of Experimental Data.pptxLecture 05 - Statistical Analysis of Experimental Data.pptx
Lecture 05 - Statistical Analysis of Experimental Data.pptx
ย 
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...
Simple Correlation : Karl Pearsonโ€™s Correlation co- efficient and Spearmanโ€™s ...
ย 
Correlation by Neeraj Bhandari ( Surkhet.Nepal )
Correlation by Neeraj Bhandari ( Surkhet.Nepal )Correlation by Neeraj Bhandari ( Surkhet.Nepal )
Correlation by Neeraj Bhandari ( Surkhet.Nepal )
ย 
ICCUBEA_2015_paper
ICCUBEA_2015_paperICCUBEA_2015_paper
ICCUBEA_2015_paper
ย 
Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2Applied Business Statistics ,ken black , ch 3 part 2
Applied Business Statistics ,ken black , ch 3 part 2
ย 

Recently uploaded

GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]๐Ÿ“Š Markus Baersch
ย 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
ย 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
ย 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
ย 
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€F La
ย 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
ย 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
ย 
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort servicejennyeacort
ย 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceSapana Sha
ย 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
ย 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
ย 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024thyngster
ย 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
ย 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
ย 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...Pooja Nehwal
ย 
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ทvhwb25kk
ย 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfLars Albertsson
ย 

Recently uploaded (20)

GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
ย 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
ย 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
ย 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
ย 
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€
ๅŠž็†(Vancouverๆฏ•ไธš่ฏไนฆ)ๅŠ ๆ‹ฟๅคงๆธฉๅ“ฅๅŽๅฒ›ๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ๅŽŸ็‰ˆไธ€ๆฏ”ไธ€
ย 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
ย 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
ย 
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service
9711147426โœจCall In girls Gurgaon Sector 31. SCO 25 escort service
ย 
Call Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts ServiceCall Girls In Dwarka 9654467111 Escorts Service
Call Girls In Dwarka 9654467111 Escorts Service
ย 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
ย 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
ย 
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
Consent & Privacy Signals on Google *Pixels* - MeasureCamp Amsterdam 2024
ย 
9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
ย 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
ย 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
ย 
Call Girls in Saket 99530๐Ÿ” 56974 Escort Service
Call Girls in Saket 99530๐Ÿ” 56974 Escort ServiceCall Girls in Saket 99530๐Ÿ” 56974 Escort Service
Call Girls in Saket 99530๐Ÿ” 56974 Escort Service
ย 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
ย 
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...{Pooja:  9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
{Pooja: 9892124323 } Call Girl in Mumbai | Jas Kaur Rate 4500 Free Hotel Del...
ย 
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท
1:1ๅฎšๅˆถ(UQๆฏ•ไธš่ฏ๏ผ‰ๆ˜†ๅฃซๅ…ฐๅคงๅญฆๆฏ•ไธš่ฏๆˆ็ปฉๅ•ไฟฎๆ”น็•™ไฟกๅญฆๅŽ†่ฎค่ฏๅŽŸ็‰ˆไธ€ๆจกไธ€ๆ ท
ย 
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdfIndustrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
ย 

20 ms-me-amd-06 (simple linear regression)

  • 1. SIMPLE LINEAR REGRESSION PREPARED BY HASSAN SHEHWAR SHAH DEPARTMENT OF MECHANICAL ENGINEERING UNIVERSITY OF ENGINEERING AND TECHNOLOGY TAXILA 3/16/2021 1
  • 2. OUTLINES ๏‚ง Introduction of linear regression ๏‚ง Simple linear regression Definition ๏‚ง Simple linear Regression Model ๏‚ง Assumption of Simple linear Regression ๏‚ง Formulas for Estimate Regression Line ๏‚ง Example 3/16/2021 2 Department of Mechanical Engineering
  • 3. INTRODUCTION TO LINEAR REGRESSION ๏‚ง Linear Regression Is Used To: โ€’ Predict The Value Of A Dependent Variable Based On The Value Of At Least One Independent Variable โ€’ Explain The Impact Of Change In An Independent Variable On The Dependent Variable Dependent Variable : The variable we wish to predict or explain Independent Variable : The variable used to explain the dependent variable 3/16/2021 3 Department of Mechanical Engineering
  • 4. SIMPLE LINEAR REGRESSION MODEL ๏‚ง Only One Independent Variable, X ๏‚ง Relationship Between X And Y Is Described By A Linear Function ๏‚ง Changes in Y Are Assumed To Be Caused By Changes in X 3/16/2021 4 Department of Mechanical Engineering
  • 5. SIMPLE LINEAR REGRESSION MODEL Yi = ฮฒ0 + ฮฒ1Xi + ิi ๏‚ง This is also known as Population Regression Model (PRM) Where Yi Dependent Variable or observation randomly drawn from Population Xi Independent variable or fixed ิi Random error or Residual ฮฒ0 & ฮฒ1 Population Parameters ฮฒ0 is Intercept ฮฒ1 Slope or Regression Coefficient 3/16/2021 5 Department of Mechanical Engineering
  • 6. SIMPLE LINEAR REGRESSION MODEL 3/16/2021 6 Y Observed Value of Y for Xi ฮตi Slope = ฮฒ1 Predicted Value of Y for Xi Random Error for this Xi value Intercept = ฮฒ0 Xi Yi = ฮฒ0 + ฮฒ1Xi X Department of Mechanical Engineering
  • 7. TYPES OF RELATIONSHIPS Y X Y X Y Y X X Strong relationships Weak relationships 3/16/2021 7 Department of Mechanical Engineering
  • 8. ASSUMPTION OF SIMPLE LINEAR REGRESSION 3/16/2021 8 โ€ข The simple linear Regression model is linear parameters. โ€ข The Independent variable X values are non random. โ€ข The residual (error) term has zero mean or the expected value of error term is zero. โ€ข The residual (error) values follow the normal distribution โ€ข There is no relationship between residual (error) term and X variable Department of Mechanical Engineering
  • 9. ESTIMATE REGRESSION MODEL ๏‚ง Let there be a set of observations (Xi, Yi) , i = 1,2,3-----n, Yi = ฮฒ0 + ฮฒ1Xi + ิi In terms of sample data Yi = b0 + b1Xi + ei Where โ€œb0โ€ and โ€œb1โ€ are least square estimate of ฮฒ0 and ฮฒ1 and ei commonly called Residual. 3/16/2021 9 Department of Mechanical Engineering
  • 10. FORMULA FOR ESTIMATION REGRESSION LINE โ€ข The least square estimates are as under b1 = ๐‘‹๐‘– ๐‘Œ๐‘– โˆ’๐‘›๐‘‹Y ๐‘‹๐‘– 2 โˆ’๐‘›๐‘‹2 (1) b0 = Yฬ… - b1Xฬ… (2) Where Xฬ… = ๐‘‹๐‘– ๐‘› & Yฬ… = ๐‘Œ๐‘– ๐‘› the parameters b0 and b1 can also be expressed in terms of sums of squares as follows: b1 = ๐‘†๐‘†๐‘‹๐‘Œ ๐‘†๐‘†๐‘‹ (3) b0 = Yฬ… - b1Xฬ… (4) 3/16/2021 10 Department of Mechanical Engineering
  • 11. FORMULA FOR ESTIMATION REGRESSION LINE SSx = ( ๐‘‹๐‘– โˆ’ Xฬ„)2 = ๐‘‹๐‘– 2 โˆ’ ๐‘›Xฬ„ (5) SSY = (๐‘Œ๐‘– โˆ’ Yฬ„)2 = ๐‘Œ๐‘– 2 โˆ’ ๐‘›Yฬ„ (6) SSxy = (๐‘‹๐‘– โˆ’ Xฬ„)(Y๐‘– โˆ’ Yฬ„) = ๐‘‹๐‘–๐‘Œ๐‘– โˆ’ ( Xi )( Yi ) n (7) ๏‚ง SSX and SSY are the terms used to determine the variance of X and variance of Y respectively. SSX and SSY are called corrected sum of squares. And ๊žต1 and ๊žต0 are estimated as follows: ๊žต1 = ๐‘†๐‘†๐‘‹๐‘Œ ๐‘†๐‘†๐‘‹ (8) ๊žต0 = Yฬ… - ๊žต1Xฬ… (9) Y = ๊žต0 + ๊žต1x is the regression equation (10) Variance of X(Sx 2) = SSx/(n-1) and (11) Variance of Y(Sx 2) = SSY/(n-1) (12) 3/16/2021 11 Department of Mechanical Engineering
  • 12. STANDARD ERROR AND ANOVA EQUATION โ€ข Similarly, we can write error sum of squares (SSe) for the regression as SSe = ๐‘’๐‘– 2 and Standard error as Se = ๐‘’๐‘– 2 ๐‘›โˆ’2 = ๐‘†๐‘†๐‘’ ๐‘‘๐‘“๐‘’ where, dfe are error degree of freedom ๏‚ง The ANOVA equation for linear regression is Total corrected sum of square = sum of squares due to regression + sum of square due to error SSTotal = SSR + SSe ๏‚ง The sum of squares are computed as follows: Let CF (Corrected factor) = ๐บ๐‘Ÿ๐‘Ž๐‘›๐‘‘ ๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™ 2 ๐‘๐‘ข๐‘š๐‘๐‘’๐‘Ÿ ๐‘œ๐‘“ ๐‘‚๐‘๐‘’๐‘Ÿ๐‘ฃ๐‘Ž๐‘ก๐‘–๐‘œ๐‘› SSTotal = ๐‘Œ๐‘– 2 โˆ’ ( ๐‘Œ๐‘– )2 ๐‘› = ๐‘Œ๐‘– 2 โˆ’ CF (13) SSR = ๊žต1SSXY (14) 3/16/2021 12 Department of Mechanical Engineering
  • 13. ANVOVA TABLE FOR SIMPLE LINEAR REGRESSION AND F-TEST Source Sum of Square Degree of Freedom Mean square F0 Regression SSR= ๊žต1SSXY 1 MSR= SSR 1 ๐‘€๐‘†๐‘… ๐‘€๐‘†๐‘’ Error SSe = SSTotal- SSR n-2 MSe = SSe (๐‘›โˆ’2) Total SSTotal = SSY n-1 3/16/2021 13 ๏‚ง Test for significance of regression is to determine if there is a linear relationship between X and Y. The appropriate hypotheses are H0 : ๊žต1 = 0 H1 : ๊žต1 โ‰  0 Reject H0 if F0 exceeds Fฮฑ,1,n-2 Rejection of H0 implies that there is significant relationship between the variable X and Y. we can also test the coefficients ๊žต0 and ๊žต1 using t test with n โ€“ 2 degrees of freedom. Department of Mechanical Engineering
  • 14. T-TEST FOR ๊žต0 AND ๊žต1 โ€ข The hypotheses are H0 : ๊žต0 = 0 H1 : ๊žต0 โ‰  0 And H0 : ๊žต1 = 0 H1 : ๊žต1 โ‰  0 ๏‚ง The test statistics for Intercept t0 = ๊žต0 ๐‘€๐‘†๐‘’ ( 1 ๐‘› + Xฬ…2 ๐‘†๐‘†๐‘‹ ) (15) Reject H0, if |t0| > tฮฑ/2,nโ€“2 ๏‚ง The test statistics for Slope t0 = ๊žต1 ๐‘€๐‘†๐‘’/๐‘†๐‘†๐‘‹ (16) Reject H0, if |t0| > tฮฑ/2,nโ€“2 3/16/2021 14 Department of Mechanical Engineering
  • 15. COEFFICIENT OF DETERMINATION (R2) โ€ข The coefficient of determination is R2 = ๐‘†๐‘†๐‘… ๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™ = 1 โˆ’ ๐‘†๐‘†๐‘’ ๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™ (17) ๏‚ง The value of R2 lie between 0 and 1. ๏‚ง The higher R2 the greater the percentage of the variation of explained by the regression plain that is the better the goodness of fit of the regression plain to the sample observations. ๏‚ง The closer R2 to zero the worse the fit. 3/16/2021 15 Department of Mechanical Engineering
  • 16. CONFIDENCE INTERVALS ON THE SLOPE AND INTERCEPT ๏‚ง A 100(1 โˆ’ ฮฑ)% confidence interval on the slope ฮฒ1 in simple linear regression is ฮฒ1 ยฑ ta/2, n-2 ๐‘€๐‘†๐‘’ ๐‘†๐‘†๐‘‹ (18) ๏‚ง Similarly, a 100(1โˆ’ ฮฑ)% confidence interval on the intercept ฮฒ0 is ฮ’0 ยฑ ta/2, n-2 ๐‘€๐‘†๐‘’( 1 ๐‘› + Xฬ„ ๐‘†๐‘†๐‘‹ ) (19) ๏‚ง A100(1โˆ’ ฮฑ)% prediction interval on a future observation Y0 at the value X0 is given by Y0 ยฑ tฮฑ/2, n-2 ๐‘€๐‘†๐‘’[1 + 1 ๐‘› + ๐‘‹0 โˆ’Xฬ„ 2 ๐‘†๐‘†๐‘‹ ] (20) 3/16/2021 16 Department of Mechanical Engineering
  • 17. EXAMPLE SIMPLE LINEAR REGRESSION A software company wants to find out whether their profit is related to the investment made in their research and development. They have collected the following data from their company records. i. Develop a simple linear regression model to the data and estimate the profit when the investment is 13 Lakh rupees. i. Test the significance of regression using F-test. ii. Test significance of ๊žต1. 3/16/2021 17 Sr. No. Investment in R&D ( in Lakhs) Annual Profit ( in LakhS) 1 2 24 2 3 25 3 4 31 4 5 34 5 11 40 6 3 31 7 10 36 8 8.5 36 9 4 29 10 6.5 33 11 8 37 12 9.5 37 13 11.5 39 14 10.5 39 15 9.5 36 Department of Mechanical Engineering
  • 18. SOLUTION EXAMPLE ๏‚ง In this problem, the profit depends on investment on R&D. Hence, X = Investment in R&D and Y = Profit 3/16/2021 18 Xฬ… = ๐‘‹๐‘– ๐‘› = 106 15 = 7.067 Yฬ… = ๐‘Œ๐‘– ๐‘› = 507 15 = 33.8 SSx= (๐‘‹๐‘– โˆ’Xฬ…)2= ๐‘‹๐‘– 2 โˆ’ nXฬ„2 = 901.5 - 15((7.067)2)=152.363 SSY = (๐‘Œ๐‘– โˆ’ Yฬ„)2 = ๐‘Œ๐‘– 2 โˆ’ nYฬ„2= 17477-15((33.8)2) = 340.4 SSXY= (๐‘‹๐‘–๐‘Œ๐‘–) โˆ’ ( ๐‘‹๐‘–)( ๐‘Œ๐‘–)/๐‘› = 3794 โˆ’ 106 507 15 = 211.2 Sr. No. X Y XY X2 Y2 1 2 24 48 4 576 2 3 25 75 9 625 3 4 31 124 16 961 4 5 34 170 25 1156 5 11 40 440 121 1600 6 3 31 93 9 961 7 10 36 360 100 1296 8 8.5 36 306 72.25 1296 9 4 29 116 16 841 10 6.5 33 214.5 42.25 1089 11 8 37 296 64 1369 12 9.5 37 351.5 90.25 1369 13 11.5 39 448.5 132.3 1521 14 10.5 39 409.5 110.3 1521 15 9.5 36 342 90.25 1296 Total 106 507 3794 901.5 17477 Department of Mechanical Engineering
  • 19. SOLUTION OF EXAMPLE CONTINUE.. ๊žต1=SSXY/SSX = 211.2 152.363 = 1.386 ๊žต0=Yฬ„ - ๊žต1Xฬ… = 33.8 โ€“ 1.386(7.067) = 24.004 The Regression Model Equation Y = ๊žต0 +๊žต1X Y = 24.004 + 1.386X (i) When the investment is 13 Lakhs, the profit Y = 24.004 + 1.386(13) =42.022 lakh (ii) SSTotal = SSY = 340.4 SSR = ๊žต1*SSXY = (1.386)(211.2) = 292.723 SSe = SSTotal โ€“ SSR =340.4 โ€“ 292.723 = 47.677 3/16/2021 19 Department of Mechanical Engineering
  • 20. EXAMPLE SOLUTION CONTINUEโ€ฆ ANOVA TABLE FOR SIMPLE LINEAR REGRESSION ๏‚ง Since F5%,1,13 = 4.67, regression is significant. That is the relation between X and Y is significant. 3/16/2021 20 Source Sum of Square Degree of Freedom Mean Square F0 Regression SSR=292.723 1 MSR=292.723 79.816 Error Sse=47.677 13 MSe=3.667 Total SSTotal 340.4 14 Department of Mechanical Engineering
  • 21. EXAMPLE SOLUTION CONTINUEโ€ฆ T-TEST FOR ๊žต1 The statistic to test the regression coefficient ๊žต1 is t0 = ๊žต1 ๐‘€๐‘†๐‘’ /๐‘†๐‘†๐‘‹ = 1.386 3.667 152.363 = 8.934 Since t0.025,13 = 2.160 the regression coefficient ๊žต1 is significant. 3/16/2021 21 Department of Mechanical Engineering
  • 22. COEFFICIENT OF DETERMINATION R-SQUARE ๏‚ง For this we have the following formula R2 = ๐‘†๐‘†๐‘… ๐‘†๐‘†๐‘‡๐‘œ๐‘ก๐‘Ž๐‘™ = 292.723 340.4 = 0.85994 ๏‚ง This mean that 85.994% change in the dependent variable occurred due to the given explanatory variable, while rest of 14.006% may be caused by random error. 3/16/2021 22 Department of Mechanical Engineering
  • 23. SIMPLE LINEAR REGRESSION ๏‚ง The coefficients ๊žต0 & ๊žต1 and all other Regression result can also find from MS Excel. 3/16/2021 23 Department of Mechanical Engineering