SlideShare a Scribd company logo
Validating OLS
Validate data
Confirm the vectors are present, run the model using lm, extract
the residuals using residuals function.
Confirming the residuals are normally distributed

Since the p-value is more than 0.05, we cannot reject the null
hypothesis. The null hypothesis for this test is the residuals are
normally distributed. This is same as Anderson-Darling test.
Confirming constant variance.
The
statistical
“speak”
for this is

heteroskedascticity (which means variance is not constant). We
run bptest, for which the null hypothesis is that the variance is constant (homoskedastic).
Note that I have used bptest from lmtest package. Here again we will reject the null if p less than 0.05
The residuals do not exhibit constant variance.
Confirming that there is no Serial or Auto Correlation

Here again the p-value is less than 0.05 and therefore we reject the null hypothesis. The null hypothesis
for this test is that there is no auto-correlation.
To learn more about these tests, kindly visit wiki or bing it.
Loading libraries as needed
try require as shown.
if require is not successful, then load the lmtest as
follows and then re-run require command as above. Use
Packages menu at the top to install a package.
Normality of the Residuals: Visual Verification

The residuals can be extracted as follows:

And the following plot is generated. If the
points deviate from the line, then the
points are not from Normal Distribution.

More Related Content

PDF
Essay on-data-analysis
PPTX
Machine Learning - Simple Linear Regression
PDF
Data Analyst - Interview Guide
PDF
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
PPTX
Logarithmic transformations
PPTX
Transformation of variables
PDF
Linear regression
PDF
Machine Learning
Essay on-data-analysis
Machine Learning - Simple Linear Regression
Data Analyst - Interview Guide
Data Science - Part XII - Ridge Regression, LASSO, and Elastic Nets
Logarithmic transformations
Transformation of variables
Linear regression
Machine Learning

What's hot (20)

PPTX
Computing transformations
PDF
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
PPTX
Introduction to MARS (1999)
PPTX
Functional Forms of Regression Models | Eonomics
PDF
Regression analysis made easy
PPTX
Stats chapter 3
PPTX
Further8 data transformation
PPTX
Outlier managment
PPT
Regression analysis ppt
PPTX
Regression Analysis
PDF
Regression Analysis - Thiyagu
PPTX
Regression analysis
PDF
Chapter 2 part2-Correlation
PPTX
Regression
PPT
Regression
PPTX
Linear regression analysis
PDF
A tour of the top 10 algorithms for machine learning newbies
PPTX
Heart disease classification
PPTX
Presentation on regression analysis
PPTX
Regression analysis
Computing transformations
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Introduction to MARS (1999)
Functional Forms of Regression Models | Eonomics
Regression analysis made easy
Stats chapter 3
Further8 data transformation
Outlier managment
Regression analysis ppt
Regression Analysis
Regression Analysis - Thiyagu
Regression analysis
Chapter 2 part2-Correlation
Regression
Regression
Linear regression analysis
A tour of the top 10 algorithms for machine learning newbies
Heart disease classification
Presentation on regression analysis
Regression analysis
Ad

Viewers also liked (18)

PDF
Evaluating classifierperformance ml-cs6923
PDF
Sdr dodd frankbirdseyeview
PDF
Cloud Computing -- Organizational Shift
PDF
Rkfut401
PDF
Enterprise Architecture
PDF
Software engineering for small product companies
PDF
Disruptive technologies 02
PDF
Joy of Unix
PDF
Innovation: Cost or Rejuvenation
PDF
Leadership 01
PDF
High Octane Productivity
PDF
Rkfut402
PDF
Cognitive Assistants
PDF
Glasses
PDF
A data scientist's study plan
PDF
Risk management framework
PPT
SW Architecture Monolithic to SOA
PDF
Financial risk management122
Evaluating classifierperformance ml-cs6923
Sdr dodd frankbirdseyeview
Cloud Computing -- Organizational Shift
Rkfut401
Enterprise Architecture
Software engineering for small product companies
Disruptive technologies 02
Joy of Unix
Innovation: Cost or Rejuvenation
Leadership 01
High Octane Productivity
Rkfut402
Cognitive Assistants
Glasses
A data scientist's study plan
Risk management framework
SW Architecture Monolithic to SOA
Financial risk management122
Ad

More from Raman Kannan (18)

PDF
conversations-withchatGPT-Claude-gemini-on-vibration-12-112024.pdf
PDF
Essays on-civic-responsibilty
PDF
M12 boosting-part02
PDF
M12 random forest-part01
PDF
M11 bagging loo cv
PDF
M10 gradient descent
PDF
M09-Cross validating-naive-bayes
PDF
M06 tree
PDF
M07 svm
PDF
M08 BiasVarianceTradeoff
PDF
Chapter 05 k nn
PDF
Chapter 04-discriminant analysis
PDF
M03 nb-02
PDF
Augmented 11022020-ieee
PDF
Chapter 02-logistic regression
PDF
Chapter01 introductory handbook
PDF
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
PDF
A voyage-inward-02
conversations-withchatGPT-Claude-gemini-on-vibration-12-112024.pdf
Essays on-civic-responsibilty
M12 boosting-part02
M12 random forest-part01
M11 bagging loo cv
M10 gradient descent
M09-Cross validating-naive-bayes
M06 tree
M07 svm
M08 BiasVarianceTradeoff
Chapter 05 k nn
Chapter 04-discriminant analysis
M03 nb-02
Augmented 11022020-ieee
Chapter 02-logistic regression
Chapter01 introductory handbook
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
A voyage-inward-02

Recently uploaded (20)

PDF
Family Law: The Role of Communication in Mediation (www.kiu.ac.ug)
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
Building a Smart Pet Ecosystem: A Full Introduction to Zhejiang Beijing Techn...
PPTX
operations management : demand supply ch
PDF
Module 2 - Modern Supervison Challenges - Student Resource.pdf
PDF
How to Get Business Funding for Small Business Fast
PPTX
Astra-Investor- business Presentation (1).pptx
PPTX
TRAINNING, DEVELOPMENT AND APPRAISAL.pptx
PPTX
sales presentation، Training Overview.pptx
PDF
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
PDF
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
PDF
How to Get Funding for Your Trucking Business
PPTX
Slide gioi thieu VietinBank Quy 2 - 2025
PDF
Tata consultancy services case study shri Sharda college, basrur
PDF
Comments on Crystal Cloud and Energy Star.pdf
PDF
IFRS Notes in your pocket for study all the time
PPTX
Negotiation and Persuasion Skills: A Shrewd Person's Perspective
PDF
Booking.com The Global AI Sentiment Report 2025
PDF
Solaris Resources Presentation - Corporate August 2025.pdf
PDF
Deliverable file - Regulatory guideline analysis.pdf
Family Law: The Role of Communication in Mediation (www.kiu.ac.ug)
Ôn tập tiếng anh trong kinh doanh nâng cao
Building a Smart Pet Ecosystem: A Full Introduction to Zhejiang Beijing Techn...
operations management : demand supply ch
Module 2 - Modern Supervison Challenges - Student Resource.pdf
How to Get Business Funding for Small Business Fast
Astra-Investor- business Presentation (1).pptx
TRAINNING, DEVELOPMENT AND APPRAISAL.pptx
sales presentation، Training Overview.pptx
NISM Series V-A MFD Workbook v December 2024.khhhjtgvwevoypdnew one must use ...
BsN 7th Sem Course GridNNNNNNNN CCN.pdf
How to Get Funding for Your Trucking Business
Slide gioi thieu VietinBank Quy 2 - 2025
Tata consultancy services case study shri Sharda college, basrur
Comments on Crystal Cloud and Energy Star.pdf
IFRS Notes in your pocket for study all the time
Negotiation and Persuasion Skills: A Shrewd Person's Perspective
Booking.com The Global AI Sentiment Report 2025
Solaris Resources Presentation - Corporate August 2025.pdf
Deliverable file - Regulatory guideline analysis.pdf

How to-run-ols-diagnostics-02

  • 1. Validating OLS Validate data Confirm the vectors are present, run the model using lm, extract the residuals using residuals function. Confirming the residuals are normally distributed Since the p-value is more than 0.05, we cannot reject the null hypothesis. The null hypothesis for this test is the residuals are normally distributed. This is same as Anderson-Darling test. Confirming constant variance. The statistical “speak” for this is heteroskedascticity (which means variance is not constant). We run bptest, for which the null hypothesis is that the variance is constant (homoskedastic). Note that I have used bptest from lmtest package. Here again we will reject the null if p less than 0.05 The residuals do not exhibit constant variance. Confirming that there is no Serial or Auto Correlation Here again the p-value is less than 0.05 and therefore we reject the null hypothesis. The null hypothesis for this test is that there is no auto-correlation. To learn more about these tests, kindly visit wiki or bing it. Loading libraries as needed try require as shown. if require is not successful, then load the lmtest as follows and then re-run require command as above. Use Packages menu at the top to install a package.
  • 2. Normality of the Residuals: Visual Verification The residuals can be extracted as follows: And the following plot is generated. If the points deviate from the line, then the points are not from Normal Distribution.