SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
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.

Weitere ähnliche Inhalte

Was ist angesagt?

Computing transformations
Computing transformationsComputing transformations
Computing transformations
Tarun Gehlot
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Rebecca Bilbro
 
Introduction to MARS (1999)
Introduction to MARS (1999)Introduction to MARS (1999)
Introduction to MARS (1999)
Salford Systems
 
Further8 data transformation
Further8  data transformationFurther8  data transformation
Further8 data transformation
kmcmullen
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
Elkana Rorio
 
Chapter 2 part2-Correlation
Chapter 2 part2-CorrelationChapter 2 part2-Correlation
Chapter 2 part2-Correlation
nszakir
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbies
Vimal Gupta
 

Was ist angesagt? (20)

Computing transformations
Computing transformationsComputing transformations
Computing transformations
 
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
Steering Model Selection with Visual Diagnostics: Women in Analytics 2019
 
Introduction to MARS (1999)
Introduction to MARS (1999)Introduction to MARS (1999)
Introduction to MARS (1999)
 
Functional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | EonomicsFunctional Forms of Regression Models | Eonomics
Functional Forms of Regression Models | Eonomics
 
Regression analysis made easy
Regression analysis made easyRegression analysis made easy
Regression analysis made easy
 
Stats chapter 3
Stats chapter 3Stats chapter 3
Stats chapter 3
 
Further8 data transformation
Further8  data transformationFurther8  data transformation
Further8 data transformation
 
Outlier managment
Outlier managmentOutlier managment
Outlier managment
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 
Regression Analysis
Regression AnalysisRegression Analysis
Regression Analysis
 
Regression Analysis - Thiyagu
Regression Analysis - ThiyaguRegression Analysis - Thiyagu
Regression Analysis - Thiyagu
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 
Chapter 2 part2-Correlation
Chapter 2 part2-CorrelationChapter 2 part2-Correlation
Chapter 2 part2-Correlation
 
Regression
Regression Regression
Regression
 
Regression
RegressionRegression
Regression
 
Linear regression analysis
Linear regression analysisLinear regression analysis
Linear regression analysis
 
A tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbiesA tour of the top 10 algorithms for machine learning newbies
A tour of the top 10 algorithms for machine learning newbies
 
Heart disease classification
Heart disease classificationHeart disease classification
Heart disease classification
 
Presentation on regression analysis
Presentation on regression analysisPresentation on regression analysis
Presentation on regression analysis
 
Regression analysis
Regression analysisRegression analysis
Regression analysis
 

Andere mochten auch

Software engineering for small product companies
Software engineering for small product companiesSoftware engineering for small product companies
Software engineering for small product companies
Raman Kannan
 
Innovation: Cost or Rejuvenation
Innovation: Cost or RejuvenationInnovation: Cost or Rejuvenation
Innovation: Cost or Rejuvenation
Raman Kannan
 
Risk management framework
Risk management frameworkRisk management framework
Risk management framework
Raman Kannan
 
Financial risk management122
Financial risk management122Financial risk management122
Financial risk management122
Raman Kannan
 

Andere mochten auch (18)

Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923
 
Sdr dodd frankbirdseyeview
Sdr dodd frankbirdseyeviewSdr dodd frankbirdseyeview
Sdr dodd frankbirdseyeview
 
Cloud Computing -- Organizational Shift
Cloud Computing -- Organizational ShiftCloud Computing -- Organizational Shift
Cloud Computing -- Organizational Shift
 
Rkfut401
Rkfut401Rkfut401
Rkfut401
 
Enterprise Architecture
Enterprise ArchitectureEnterprise Architecture
Enterprise Architecture
 
Software engineering for small product companies
Software engineering for small product companiesSoftware engineering for small product companies
Software engineering for small product companies
 
Disruptive technologies 02
Disruptive technologies  02Disruptive technologies  02
Disruptive technologies 02
 
Joy of Unix
Joy of UnixJoy of Unix
Joy of Unix
 
Innovation: Cost or Rejuvenation
Innovation: Cost or RejuvenationInnovation: Cost or Rejuvenation
Innovation: Cost or Rejuvenation
 
Leadership 01
Leadership  01Leadership  01
Leadership 01
 
High Octane Productivity
High Octane ProductivityHigh Octane Productivity
High Octane Productivity
 
Rkfut402
Rkfut402Rkfut402
Rkfut402
 
Cognitive Assistants
Cognitive AssistantsCognitive Assistants
Cognitive Assistants
 
Glasses
GlassesGlasses
Glasses
 
A data scientist's study plan
A data scientist's study planA data scientist's study plan
A data scientist's study plan
 
Risk management framework
Risk management frameworkRisk management framework
Risk management framework
 
SW Architecture Monolithic to SOA
SW Architecture Monolithic to SOASW Architecture Monolithic to SOA
SW Architecture Monolithic to SOA
 
Financial risk management122
Financial risk management122Financial risk management122
Financial risk management122
 

Ähnlich wie How to-run-ols-diagnostics-02

pydata_confernence_july_2016_modified_sunday_final
pydata_confernence_july_2016_modified_sunday_finalpydata_confernence_july_2016_modified_sunday_final
pydata_confernence_july_2016_modified_sunday_final
Austin Powell
 
1Running head RESEARCH PROJECT PROPOSAL 13RESEA.docx
1Running head RESEARCH PROJECT PROPOSAL    13RESEA.docx1Running head RESEARCH PROJECT PROPOSAL    13RESEA.docx
1Running head RESEARCH PROJECT PROPOSAL 13RESEA.docx
felicidaddinwoodie
 
Chapter 20 and 21 combined testing hypotheses about proportions 2013
Chapter 20 and 21 combined testing hypotheses about proportions 2013Chapter 20 and 21 combined testing hypotheses about proportions 2013
Chapter 20 and 21 combined testing hypotheses about proportions 2013
calculistictt
 
8 Statistical SignificanceOK, measures of association are one .docx
8 Statistical SignificanceOK, measures of association are one .docx8 Statistical SignificanceOK, measures of association are one .docx
8 Statistical SignificanceOK, measures of association are one .docx
evonnehoggarth79783
 
Week 3 Lecture 9 Effect Size When we reject the null h.docx
Week 3 Lecture 9 Effect Size When we reject the null h.docxWeek 3 Lecture 9 Effect Size When we reject the null h.docx
Week 3 Lecture 9 Effect Size When we reject the null h.docx
cockekeshia
 
WEEK 6 – HOMEWORK 6 LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
WEEK 6 – HOMEWORK 6  LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docxWEEK 6 – HOMEWORK 6  LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
WEEK 6 – HOMEWORK 6 LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
cockekeshia
 

Ähnlich wie How to-run-ols-diagnostics-02 (17)

Directional Hypothesis testing
Directional Hypothesis testing Directional Hypothesis testing
Directional Hypothesis testing
 
Interpreting Regression Results - Machine Learning
Interpreting Regression Results - Machine LearningInterpreting Regression Results - Machine Learning
Interpreting Regression Results - Machine Learning
 
Data science classica_hypos
Data science classica_hyposData science classica_hypos
Data science classica_hypos
 
4. correlations
4. correlations4. correlations
4. correlations
 
Stats chapter 11
Stats chapter 11Stats chapter 11
Stats chapter 11
 
pydata_confernence_july_2016_modified_sunday_final
pydata_confernence_july_2016_modified_sunday_finalpydata_confernence_july_2016_modified_sunday_final
pydata_confernence_july_2016_modified_sunday_final
 
1Running head RESEARCH PROJECT PROPOSAL 13RESEA.docx
1Running head RESEARCH PROJECT PROPOSAL    13RESEA.docx1Running head RESEARCH PROJECT PROPOSAL    13RESEA.docx
1Running head RESEARCH PROJECT PROPOSAL 13RESEA.docx
 
Math3010 week 5
Math3010 week 5Math3010 week 5
Math3010 week 5
 
chapter_7.pptx
chapter_7.pptxchapter_7.pptx
chapter_7.pptx
 
Stats chapter 11
Stats chapter 11Stats chapter 11
Stats chapter 11
 
Chapter 20 and 21 combined testing hypotheses about proportions 2013
Chapter 20 and 21 combined testing hypotheses about proportions 2013Chapter 20 and 21 combined testing hypotheses about proportions 2013
Chapter 20 and 21 combined testing hypotheses about proportions 2013
 
chap4_Parametric_Methods.ppt
chap4_Parametric_Methods.pptchap4_Parametric_Methods.ppt
chap4_Parametric_Methods.ppt
 
8 Statistical SignificanceOK, measures of association are one .docx
8 Statistical SignificanceOK, measures of association are one .docx8 Statistical SignificanceOK, measures of association are one .docx
8 Statistical SignificanceOK, measures of association are one .docx
 
Bio-statistics definitions and misconceptions
Bio-statistics definitions and misconceptionsBio-statistics definitions and misconceptions
Bio-statistics definitions and misconceptions
 
Week 3 Lecture 9 Effect Size When we reject the null h.docx
Week 3 Lecture 9 Effect Size When we reject the null h.docxWeek 3 Lecture 9 Effect Size When we reject the null h.docx
Week 3 Lecture 9 Effect Size When we reject the null h.docx
 
WEEK 6 – HOMEWORK 6 LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
WEEK 6 – HOMEWORK 6  LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docxWEEK 6 – HOMEWORK 6  LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
WEEK 6 – HOMEWORK 6 LANE CHAPTERS, 11, 12, AND 13; ILLOWSKY CHAP.docx
 
SPSS OUTPUT ANALYSIS FOR Marketing research.
SPSS OUTPUT ANALYSIS FOR Marketing research.SPSS OUTPUT ANALYSIS FOR Marketing research.
SPSS OUTPUT ANALYSIS FOR Marketing research.
 

Mehr von Raman Kannan

Mehr von Raman Kannan (17)

Essays on-civic-responsibilty
Essays on-civic-responsibiltyEssays on-civic-responsibilty
Essays on-civic-responsibilty
 
M12 boosting-part02
M12 boosting-part02M12 boosting-part02
M12 boosting-part02
 
M12 random forest-part01
M12 random forest-part01M12 random forest-part01
M12 random forest-part01
 
M11 bagging loo cv
M11 bagging loo cvM11 bagging loo cv
M11 bagging loo cv
 
M10 gradient descent
M10 gradient descentM10 gradient descent
M10 gradient descent
 
M09-Cross validating-naive-bayes
M09-Cross validating-naive-bayesM09-Cross validating-naive-bayes
M09-Cross validating-naive-bayes
 
M06 tree
M06 treeM06 tree
M06 tree
 
M07 svm
M07 svmM07 svm
M07 svm
 
M08 BiasVarianceTradeoff
M08 BiasVarianceTradeoffM08 BiasVarianceTradeoff
M08 BiasVarianceTradeoff
 
Chapter 05 k nn
Chapter 05 k nnChapter 05 k nn
Chapter 05 k nn
 
Chapter 04-discriminant analysis
Chapter 04-discriminant analysisChapter 04-discriminant analysis
Chapter 04-discriminant analysis
 
M03 nb-02
M03 nb-02M03 nb-02
M03 nb-02
 
Augmented 11022020-ieee
Augmented 11022020-ieeeAugmented 11022020-ieee
Augmented 11022020-ieee
 
Chapter 02-logistic regression
Chapter 02-logistic regressionChapter 02-logistic regression
Chapter 02-logistic regression
 
Chapter01 introductory handbook
Chapter01 introductory handbookChapter01 introductory handbook
Chapter01 introductory handbook
 
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
Chapter 2: R tutorial Handbook for Data Science and Machine Learning Practiti...
 
A voyage-inward-02
A voyage-inward-02A voyage-inward-02
A voyage-inward-02
 

Kürzlich hochgeladen

Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
vineshkumarsajnani12
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
ZurliaSoop
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
allensay1
 

Kürzlich hochgeladen (20)

Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
 
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
 
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptx
 
PHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation FinalPHX May 2024 Corporate Presentation Final
PHX May 2024 Corporate Presentation Final
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Chennai Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Av...
Chennai Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Av...Chennai Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Av...
Chennai Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Av...
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
 
WheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond InsightsWheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond Insights
 
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al MizharAl Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
Al Mizhar Dubai Escorts +971561403006 Escorts Service In Al Mizhar
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
 

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.