SlideShare a Scribd company logo
1 of 42
1. Introduction to Linear Regression
2. Tests for Normality of Residuals
3. Tests for Heteroscedasticity
4. Tests for Multicollinearity
5. Tests for Autocorrelation
6. Tests for Model Specification
Linear Regression Analysis
1. Introduction to
Linear Regression
Linear Regression
The command regress is used to perform
linear regressions. The first variable after
the regress command is always the
dependent variable ( left-hand-side
variable), and the list of the independent
variables that we chose to include in the
estimation model follows ( right-hand-side
variables).
Linear Regression
. clear
. use hs1, clear
. regress write read female
Source | SS df MS Number of obs =
+ F( 2, 197) =
Model | Prob > F
Residual |
7856.32118 2 3928.16059
10022.5538 197 50.8759077 R-squared
+ Adj R-squared =
Total | 17878.875 199 89.843593 Root MSE =
200
77.21
= 0.0000
= 0.4394
0.4337
7.1327
write | Coef. Std. Err. t P>|t| [95% Conf. Interval]
+
read | .5658869 .0493849 11.46 0.000 .468496 .6632778
female | 5.486894 1.014261 5.41 0.000 3.48669 7.487098
_cons | 20.22837 2.713756 7.45 0.000 14.87663 25.58011
2. Tests for
Normality of
Residuals
Tests for Normality of Residuals
We use the predict command with the resid
option to generate residuals and we name the
residuals r.
. predict r, resid
Tests for Normality of Residuals
Shapiro-Wilk W test for Normality
For verifying that the
residuals are normally distributed, which is
a very important assumption for regression,
we use Shapiro-Wilk W test for normal data
Tests for Normality of Residuals
Shapiro-Wilk W test for Normality
For verifying that the
residuals are normally distributed, which is
a very important assumption for regression,
we use Shapiro-Wilk W test for normal data
. swilk r
Tests for Normality of Residuals
Shapiro-Wilk W test for Normality
For verifying that the
residuals are normally distributed, which is
a very important assumption for regression,
we use Shapiro-Wilk W test for normal data
. swilk r
Shapiro-Wilk W test for normal data
Variable | Obs W V z Prob>z
+
r | 200 0.98714 1.919 1.499 0.06692
Tests for Normality of Residuals
In verifying that the
residuals are normally distributed, which is
a very important assumption for regression,
the kdensity command with the normal option
displays a
density graph of the residuals
with an
normal distribution superimposed
on the graph.
Tests for Normality of Residuals
. kdensity r, normal
Tests for Normality of Residuals
. kdensity r, normal
Tests for Normality of Residuals
The pnorm command produces a
normal probability plot and
it is another method of
testing whether the
residuals from the regression are normally
distributed.
Tests for Normality of Residuals
. pnorm r
Tests for Normality of Residuals
. pnorm r
Tests for Normality of Residuals
The qnorm command produces a
normal quantile plot.
It is yet another method for testing if the
residuals are normally distributed.
Tests for Normality of Residuals
. qnorm r
Tests for Normality of Residuals
. qnorm r
Summary of Tests for Normality of Residuals
swilk performs the Shapiro-Wilk W test for
normality.
kdensity produces kernel density plot with normal
distribution overlayed.
pnorm
qnorm
graphs a standardized normal probability
(P-P) plot.
plots the quantiles of varname against the
quantiles of a normal distribution.
Tests for Normality of Residuals
3. Tests for
Heteroscedasticity
Tests for Heteroscedasticity
One of the basic assumptions for the ordinary
least squares regression is the homogeneity of
variance of the residuals.
There are graphical and non-graphical methods
for detecting heteroscedasticity.
Tests for Heteroscedasticity
Cook-Weisberg test for heteroskedasticity
Tests for Heteroscedasticity
Cook-Weisberg test for heteroskedasticity
. hettest
Cook-Weisberg test for heteroskedasticity using
fitted values of write
Ho: Constant variance
chi2(1) =
Prob > chi2 =
5.79
0.0161
Tests for Heteroscedasticity
we use the rvfplot command with the yline(0)
option to put a reference line at y=0.
Tests for Heteroscedasticity
we use the rvfplot command with the yline(0)
option to put a reference line at y=0.
. rvfplot, yline(0)
Tests for Heteroscedasticity
we use the rvfplot command with the yline(0)
option to put a reference line at y=0.
. rvfplot, yline(0)
Summary of Tests for Heteroscedasticity
hettest performs Cook and Weisberg test
rvfplot graphs residual-versus-fitted plot.
Tests for Heteroscedasticity
4. Tests for
Multicollinearity
Tests for Multicollinearity
Multicollinearity is a concern for multiple
regression, not for its existence, but for its
degree.
For severe degree of multicollinearity, the
regression model
estimates of the coefficients become unstable
and
the standard errors for the coefficients can get
wildly inflated.
Tests for Multicollinearity
We can use the vif command after the regression to
check for multicollinearity.
vif stands for variance inflation factor.
Tests for Multicollinearity
We can use the vif command after the regression to
check for multicollinearity.
vif stands for variance inflation factor.
. vif
Variable | VIF 1/VIF
+
female |
read |
1.00
1.00
0.997182
0.997182
+
Mean VIF | 1.00
Tests for Multicollinearity
We can use the vif command after the regression to
check for multicollinearity.
. vif
Variable | VIF
+
female |
read |
1.00
1.00
Mean VIF | 1.00
A variable whose
VIF values are
vif stands for variance inflation factor. greater than 10 may
merit further
investigation.
Tolerance= 1/VIF, is
used to check on
1/VIF
the degree of
0.997182 collinearity. A
0.997182 tolerance value
+ lower than 0.1 is
comparable to a VIF
of 10.
Tests for Multicollinearity
Summary of Tests for Multicollinearity
vif calculates the variance inflation factor for the
independent variables in the linear model.
5. Tests for
Autocorrelation
Tests for Autocorrelation
. tsset id
time variable: id, 1 to 200
. dwstat
Durbin-Watson d-statistic( 3, 200) = 1.93992
Tests for Model Specification
A model specification error can occur when one or more
relevant variables are omitted from the model or one or
more irrelevant variables are included in the model.
Tests for Model Specification
There are several methods to detect
specification errors.
The linktest command performs a model
specification link test for single-equation models.
Tests for Model Specification
. Linktest
Source | SS df MS Number of obs =
+ F( 2, 197) =
Model | Prob > F
Residual |
8005.11739 2 4002.55869
9873.75761 197 50.120597 R-squared
+
Total | 17878.875 199 89.843593
Adj R-squared =
Root MSE =
200
79.86
= 0.0000
= 0.4477
0.4421
7.0796
write | Coef. Std. Err. t P>|t| [95% Conf. Interval]
+
_hat | 2.807497 1.052071 2.67 0.008 .7327302 4.882264
_hatsq | -.0170281 .0098827 -1.72 0.086 -.0365176 .0024615
_cons | -47.29516 27.77544 -1.70 0.090 -102.0705 7.480201
Tests for Model Specification
The ovtest command performs performs a
regression specification error test (RESET) for
omitted variables.
Tests for Model Specification
The ovtest command performs performs a
regression specification error test (RESET) for
omitted variables.
. ovtest
Tests for Model Specification
The ovtest command performs performs a
regression specification error test (RESET) for
omitted variables.
. ovtest
Ramsey RESET test using powers of the fitted values
of write
Ho: model has no omitted variables
F(3, 194) = 1.95
Prob > F = 0.1233
Tests for Model Specification
Summary of Tests for Model Specification
linktest performs a link test for model specification.
ovtest performs regression specification error
test (RESET) for omitted variables.

More Related Content

Similar to STATA Appplication.pptx

2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_fariaPaulo Faria
 
Statr session 23 and 24
Statr session 23 and 24Statr session 23 and 24
Statr session 23 and 24Ruru Chowdhury
 
Regression inference confidence intervals
Regression inference confidence intervalsRegression inference confidence intervals
Regression inference confidence intervalsamylute
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inferenceKemal İnciroğlu
 
Cross validation
Cross validationCross validation
Cross validationRidhaAfrawe
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.pptRufesh
 
ITS World Congress :: Vienna, Oct 2012
ITS World Congress :: Vienna, Oct 2012ITS World Congress :: Vienna, Oct 2012
ITS World Congress :: Vienna, Oct 2012László Nádai
 
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...Dr.Summiya Parveen
 
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...Data Approximation in Mathematical Modelling Regression Analysis and curve fi...
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...Dr.Summiya Parveen
 
Numerical
NumericalNumerical
Numerical1821986
 
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...SYRTO Project
 
Auto MPG Regression Analysis
Auto MPG Regression AnalysisAuto MPG Regression Analysis
Auto MPG Regression AnalysisAnirudh Srinath.V
 
Intro to Feature Selection
Intro to Feature SelectionIntro to Feature Selection
Intro to Feature Selectionchenhm
 

Similar to STATA Appplication.pptx (20)

2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria2014-mo444-practical-assignment-04-paulo_faria
2014-mo444-practical-assignment-04-paulo_faria
 
Statr session 23 and 24
Statr session 23 and 24Statr session 23 and 24
Statr session 23 and 24
 
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
MUMS: Transition & SPUQ Workshop - Gradient-Free Construction of Active Subsp...
 
2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data 2. diagnostics, collinearity, transformation, and missing data
2. diagnostics, collinearity, transformation, and missing data
 
Multiple Regression
Multiple RegressionMultiple Regression
Multiple Regression
 
Regression inference confidence intervals
Regression inference confidence intervalsRegression inference confidence intervals
Regression inference confidence intervals
 
Simple lin regress_inference
Simple lin regress_inferenceSimple lin regress_inference
Simple lin regress_inference
 
Cross validation
Cross validationCross validation
Cross validation
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
ARIMA
ARIMA ARIMA
ARIMA
 
604_multiplee.ppt
604_multiplee.ppt604_multiplee.ppt
604_multiplee.ppt
 
ITS World Congress :: Vienna, Oct 2012
ITS World Congress :: Vienna, Oct 2012ITS World Congress :: Vienna, Oct 2012
ITS World Congress :: Vienna, Oct 2012
 
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...
Data Approximation in Mathematical Modelling Regression Analysis and Curve Fi...
 
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...Data Approximation in Mathematical Modelling Regression Analysis and curve fi...
Data Approximation in Mathematical Modelling Regression Analysis and curve fi...
 
Numerical
NumericalNumerical
Numerical
 
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...
MEM and SEM in the GME framework: Modelling Perception and Satisfaction - Car...
 
Oh2423312334
Oh2423312334Oh2423312334
Oh2423312334
 
Auto MPG Regression Analysis
Auto MPG Regression AnalysisAuto MPG Regression Analysis
Auto MPG Regression Analysis
 
Intro to Feature Selection
Intro to Feature SelectionIntro to Feature Selection
Intro to Feature Selection
 

Recently uploaded

Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessAggregage
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...lizamodels9
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfmuskan1121w
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...lizamodels9
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...lizamodels9
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...lizamodels9
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 
Non Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxNon Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxAbhayThakur200703
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurSuhani Kapoor
 

Recently uploaded (20)

Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for Success
 
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
Lowrate Call Girls In Sector 18 Noida ❤️8860477959 Escorts 100% Genuine Servi...
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdf
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc.../:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
/:Call Girls In Jaypee Siddharth - 5 Star Hotel New Delhi ➥9990211544 Top Esc...
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
 
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
Call Girls In Connaught Place Delhi ❤️88604**77959_Russian 100% Genuine Escor...
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 
Non Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxNon Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptx
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
 

STATA Appplication.pptx

  • 1. 1. Introduction to Linear Regression 2. Tests for Normality of Residuals 3. Tests for Heteroscedasticity 4. Tests for Multicollinearity 5. Tests for Autocorrelation 6. Tests for Model Specification Linear Regression Analysis
  • 3. Linear Regression The command regress is used to perform linear regressions. The first variable after the regress command is always the dependent variable ( left-hand-side variable), and the list of the independent variables that we chose to include in the estimation model follows ( right-hand-side variables).
  • 4. Linear Regression . clear . use hs1, clear . regress write read female Source | SS df MS Number of obs = + F( 2, 197) = Model | Prob > F Residual | 7856.32118 2 3928.16059 10022.5538 197 50.8759077 R-squared + Adj R-squared = Total | 17878.875 199 89.843593 Root MSE = 200 77.21 = 0.0000 = 0.4394 0.4337 7.1327 write | Coef. Std. Err. t P>|t| [95% Conf. Interval] + read | .5658869 .0493849 11.46 0.000 .468496 .6632778 female | 5.486894 1.014261 5.41 0.000 3.48669 7.487098 _cons | 20.22837 2.713756 7.45 0.000 14.87663 25.58011
  • 5. 2. Tests for Normality of Residuals
  • 6. Tests for Normality of Residuals We use the predict command with the resid option to generate residuals and we name the residuals r. . predict r, resid
  • 7. Tests for Normality of Residuals Shapiro-Wilk W test for Normality For verifying that the residuals are normally distributed, which is a very important assumption for regression, we use Shapiro-Wilk W test for normal data
  • 8. Tests for Normality of Residuals Shapiro-Wilk W test for Normality For verifying that the residuals are normally distributed, which is a very important assumption for regression, we use Shapiro-Wilk W test for normal data . swilk r
  • 9. Tests for Normality of Residuals Shapiro-Wilk W test for Normality For verifying that the residuals are normally distributed, which is a very important assumption for regression, we use Shapiro-Wilk W test for normal data . swilk r Shapiro-Wilk W test for normal data Variable | Obs W V z Prob>z + r | 200 0.98714 1.919 1.499 0.06692
  • 10. Tests for Normality of Residuals In verifying that the residuals are normally distributed, which is a very important assumption for regression, the kdensity command with the normal option displays a density graph of the residuals with an normal distribution superimposed on the graph.
  • 11. Tests for Normality of Residuals . kdensity r, normal
  • 12. Tests for Normality of Residuals . kdensity r, normal
  • 13. Tests for Normality of Residuals The pnorm command produces a normal probability plot and it is another method of testing whether the residuals from the regression are normally distributed.
  • 14. Tests for Normality of Residuals . pnorm r
  • 15. Tests for Normality of Residuals . pnorm r
  • 16. Tests for Normality of Residuals The qnorm command produces a normal quantile plot. It is yet another method for testing if the residuals are normally distributed.
  • 17. Tests for Normality of Residuals . qnorm r
  • 18. Tests for Normality of Residuals . qnorm r
  • 19. Summary of Tests for Normality of Residuals swilk performs the Shapiro-Wilk W test for normality. kdensity produces kernel density plot with normal distribution overlayed. pnorm qnorm graphs a standardized normal probability (P-P) plot. plots the quantiles of varname against the quantiles of a normal distribution. Tests for Normality of Residuals
  • 21. Tests for Heteroscedasticity One of the basic assumptions for the ordinary least squares regression is the homogeneity of variance of the residuals. There are graphical and non-graphical methods for detecting heteroscedasticity.
  • 22. Tests for Heteroscedasticity Cook-Weisberg test for heteroskedasticity
  • 23. Tests for Heteroscedasticity Cook-Weisberg test for heteroskedasticity . hettest Cook-Weisberg test for heteroskedasticity using fitted values of write Ho: Constant variance chi2(1) = Prob > chi2 = 5.79 0.0161
  • 24. Tests for Heteroscedasticity we use the rvfplot command with the yline(0) option to put a reference line at y=0.
  • 25. Tests for Heteroscedasticity we use the rvfplot command with the yline(0) option to put a reference line at y=0. . rvfplot, yline(0)
  • 26. Tests for Heteroscedasticity we use the rvfplot command with the yline(0) option to put a reference line at y=0. . rvfplot, yline(0)
  • 27. Summary of Tests for Heteroscedasticity hettest performs Cook and Weisberg test rvfplot graphs residual-versus-fitted plot. Tests for Heteroscedasticity
  • 29. Tests for Multicollinearity Multicollinearity is a concern for multiple regression, not for its existence, but for its degree. For severe degree of multicollinearity, the regression model estimates of the coefficients become unstable and the standard errors for the coefficients can get wildly inflated.
  • 30. Tests for Multicollinearity We can use the vif command after the regression to check for multicollinearity. vif stands for variance inflation factor.
  • 31. Tests for Multicollinearity We can use the vif command after the regression to check for multicollinearity. vif stands for variance inflation factor. . vif Variable | VIF 1/VIF + female | read | 1.00 1.00 0.997182 0.997182 + Mean VIF | 1.00
  • 32. Tests for Multicollinearity We can use the vif command after the regression to check for multicollinearity. . vif Variable | VIF + female | read | 1.00 1.00 Mean VIF | 1.00 A variable whose VIF values are vif stands for variance inflation factor. greater than 10 may merit further investigation. Tolerance= 1/VIF, is used to check on 1/VIF the degree of 0.997182 collinearity. A 0.997182 tolerance value + lower than 0.1 is comparable to a VIF of 10.
  • 33. Tests for Multicollinearity Summary of Tests for Multicollinearity vif calculates the variance inflation factor for the independent variables in the linear model.
  • 35. Tests for Autocorrelation . tsset id time variable: id, 1 to 200 . dwstat Durbin-Watson d-statistic( 3, 200) = 1.93992
  • 36. Tests for Model Specification A model specification error can occur when one or more relevant variables are omitted from the model or one or more irrelevant variables are included in the model.
  • 37. Tests for Model Specification There are several methods to detect specification errors. The linktest command performs a model specification link test for single-equation models.
  • 38. Tests for Model Specification . Linktest Source | SS df MS Number of obs = + F( 2, 197) = Model | Prob > F Residual | 8005.11739 2 4002.55869 9873.75761 197 50.120597 R-squared + Total | 17878.875 199 89.843593 Adj R-squared = Root MSE = 200 79.86 = 0.0000 = 0.4477 0.4421 7.0796 write | Coef. Std. Err. t P>|t| [95% Conf. Interval] + _hat | 2.807497 1.052071 2.67 0.008 .7327302 4.882264 _hatsq | -.0170281 .0098827 -1.72 0.086 -.0365176 .0024615 _cons | -47.29516 27.77544 -1.70 0.090 -102.0705 7.480201
  • 39. Tests for Model Specification The ovtest command performs performs a regression specification error test (RESET) for omitted variables.
  • 40. Tests for Model Specification The ovtest command performs performs a regression specification error test (RESET) for omitted variables. . ovtest
  • 41. Tests for Model Specification The ovtest command performs performs a regression specification error test (RESET) for omitted variables. . ovtest Ramsey RESET test using powers of the fitted values of write Ho: model has no omitted variables F(3, 194) = 1.95 Prob > F = 0.1233
  • 42. Tests for Model Specification Summary of Tests for Model Specification linktest performs a link test for model specification. ovtest performs regression specification error test (RESET) for omitted variables.