Metrics Lab Econometric Problems Lab. Import the Macro data from Excel and use first row as variable names Time set the year variable by typing “tsset.

Slides:



Advertisements
Similar presentations
Introduction Describe what panel data is and the reasons for using it in this format Assess the importance of fixed and random effects Examine the Hausman.
Advertisements

Regression Analysis.
Managerial Economics in a Global Economy
STATA Introductory manual. QUIZ What are the main OLS assumptions? 1.On average right 2.Linear 3.Predicting variables and error term uncorrelated 4.No.
Hypothesis Testing Steps in Hypothesis Testing:
Inference for Regression
Chapter 11 Autocorrelation.
Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
Objectives (BPS chapter 24)
1 Multiple Regression Model Error Term Assumptions –Example 1: Locating a motor inn Goodness of Fit (R-square) Validity of estimates (t-stats & F-stats)
Classical Regression III
© 2010 Pearson Prentice Hall. All rights reserved Least Squares Regression Models.
LINEAR REGRESSION: Evaluating Regression Models Overview Assumptions for Linear Regression Evaluating a Regression Model.
LINEAR REGRESSION: Evaluating Regression Models. Overview Assumptions for Linear Regression Evaluating a Regression Model.
Chapter 13 Additional Topics in Regression Analysis
PSY 307 – Statistics for the Behavioral Sciences
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc. Chap 13-1 Chapter 13 Simple Linear Regression Basic Business Statistics 11 th Edition.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.Chap 13-1 Statistics for Managers Using Microsoft® Excel 5th Edition Chapter.
Pengujian Parameter Koefisien Korelasi Pertemuan 04 Matakuliah: I0174 – Analisis Regresi Tahun: Ganjil 2007/2008.
Regression Diagnostics - I
Topic 3: Regression.
Business Statistics - QBM117 Statistical inference for regression.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc. Chap 13-1 Chapter 13 Simple Linear Regression Basic Business Statistics 10 th Edition.
Correlation and Regression Analysis
Chapter 7 Forecasting with Simple Regression
Introduction to Regression Analysis, Chapter 13,
Introduction to Linear Regression and Correlation Analysis
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 12-1 Chapter 12 Simple Linear Regression Statistics for Managers Using.
1 MADE WHAT IF SOME OLS ASSUMPTIONS ARE NOT FULFILED?
Hypothesis Testing in Linear Regression Analysis
Regression Method.
Multiple Regression. In the previous section, we examined simple regression, which has just one independent variable on the right side of the equation.
Understanding Multivariate Research Berry & Sanders.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on the Least-Squares Regression Model and Multiple Regression 14.
© 2003 Prentice-Hall, Inc.Chap 13-1 Basic Business Statistics (9 th Edition) Chapter 13 Simple Linear Regression.
+ Chapter 12: Inference for Regression Inference for Linear Regression.
Chap 14-1 Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chapter 14 Additional Topics in Regression Analysis Statistics for Business.
Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Byron Gangnes Econ 427 lecture 3 slides. Byron Gangnes A scatterplot.
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
Copyright ©2011 Brooks/Cole, Cengage Learning Inference about Simple Regression Chapter 14 1.
Diagnostics – Part II Using statistical tests to check to see if the assumptions we made about the model are realistic.
Lecture 10: Correlation and Regression Model.
STAT 497 LECTURE NOTE 9 DIAGNOSTIC CHECKS 1. After identifying and estimating a time series model, the goodness-of-fit of the model and validity of the.
I271B QUANTITATIVE METHODS Regression and Diagnostics.
© Copyright McGraw-Hill 2004
Residual Analysis Purposes –Examine Functional Form (Linear vs. Non- Linear Model) –Evaluate Violations of Assumptions Graphical Analysis of Residuals.
Statistics for Managers Using Microsoft® Excel 5th Edition
Chapter 12 Simple Linear Regression.
1 Regression Review Population Vs. Sample Regression Line Residual and Standard Error of Regression Interpretation of intercept & slope T-test, F-test.
Chapter 9 Minitab Recipe Cards. Contingency tests Enter the data from Example 9.1 in C1, C2 and C3.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 12-1 Chapter 12 Simple Linear Regression Statistics for Managers Using.
Chapter 10 Section 5 Chi-squared Test for a Variance or Standard Deviation.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
Introduction to Eviews Eviews Workshop September 6, :30 p.m.-3:30 p.m.
1 Assessment and Interpretation: MBA Program Admission Policy The dean of a large university wants to raise the admission standards to the popular MBA.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Lecture 9 Forecasting. Introduction to Forecasting * * * * * * * * o o o o o o o o Model 1Model 2 Which model performs better? There are many forecasting.
REGRESSION DIAGNOSTIC III: AUTOCORRELATION
Statistics for Managers using Microsoft Excel 3rd Edition
Correlation – Regression
Simple Linear Regression
Lab 9 – Regression Diagnostics
Chapter 13 Simple Linear Regression
STAT 497 LECTURE NOTE 9 DIAGNOSTIC CHECKS.
I271B Quantitative Methods
BEC 30325: MANAGERIAL ECONOMICS
BEC 30325: MANAGERIAL ECONOMICS
Presentation transcript:

Metrics Lab Econometric Problems Lab

Import the Macro data from Excel and use first row as variable names Time set the year variable by typing “tsset year” into the command window. STATA now knows that is a time series data allowing operators such as lag and lead to work Run a basic OLS regression using personal consumption as the dependent variable. “regress personalconsumption gdp disposableincome unemploymentrate year” Import Data and Run Basic Regression

To generate the residuals in stata type the command: “predict resid, r”  This tells STATA that you are generating a new variable, naming it resid, and you want it to equal the error terms from the model. Your residuals will appear in your data editor STATA-Generating Residuals

To generate the fitted values, type: “predict yhat, xb”  This tells STATA that you want to generate a new variable named yhat where it equals the predicted values of the model. Your fitted values will appear in your data editor STATA-Generating Fitted Values

To plot your residuals against your fitted values type “scatter yhat resid” You may also use “plot yhat resid” to have you results appear in the results window. In a new window, you’ll see the scatter plot. Plotting Residuals and Fitted Values

Residuals Vs. Predicted Values

Regress with Squared Residuals

Heteroskedasticity Heteroskedasticity occurs when the error variance has non- constant variance. Error variance definition: the portion of the variance in a set of scores that is due to extraneous variables and measurement error. Can someone explain me the difference between errors and residuals? The variance of the observed value of the dependent variable around the regression line is non-constant.

Difference between Errors and Residuals The error (or disturbance) of an observed value is the deviation of the observed value from the (unobservable) true value of a quantity of interest (for example, a population mean) Ex. The difference between the height of each man in the sample and the unobservable population mean The residual of an observed value is the difference between the observed value and the estimated value of the quantity of interest (for example, a sample mean). Ex. The difference between the height of each man in the sample and the observable sample mean

To determine if you have heteroskedasticity you’ll want to run either a White test or the Breusch-Pagan/Cook- Weisberg test for heteroskedasticity. To run the Breusch-Pagan test, type “estat hettest” directly after running your regression. STATA- Detecting Heteroskedasticity Compare the chi-square statistic to a table. The high p-value indicates that heteroskedasticity is not a problem here.

Breusch-Pagan/Cook-Weisberg Test It tests whether the estimated variance of the residuals from a regression are dependent on the values of the independent variables. In that case, heteroskedasticity is present. The Breusch–Pagan test tests for conditional heteroskedasticity. It is a chi-squared test: the test statistic is n χ 2 with k degrees of freedom. It tests the null hypothesis of homoskedasticity. If the Chi Squared value is significant with p-value below an appropriate threshold (e.g. p<0.05) then the null hypothesis of homoskedasticity is rejected and heteroskedasticity assumed. If the errors have constant variance, the errors are called homoscedastic

To conduct a white test, type “imtest, white” directly following your regression. White Test

It’s similar to the Breusch-Pagan test, but the White test allows the independent variable to have a nonlinear and interactive effect on the error variance. Skewness Kurtosis

To determine non-normality of error terms, or skewness, you want to run a JB test. The command for the skewness test is “sktest resid” where resid is the name of your residuals STATA-Detecting Skewness If the number is bigger than 5.99 (Chi-square with 2 df at the 5 % level) your error terms are not normally distributed and you have a problem.

JB test continued Alternatively you can install the JB test into stata using the command: “ssc install jb” After installation you can run the jb test using the command: “jb res” where res is the name of the variable with the residual values from your regression

You may also wish to see a histogram of the residuals. Command: “histogram resid” –the histogram will appear in a new window. Plotting Residuals

To detect multicollinearity in STATA you will want to create a correlation matrix. Command: “Correl varlist” STATA-Detecting Multicollinearity rho’s of o.5 or greater should give you concern.

To detect autocorrelation, you will want to run a Durbin-Watson test. Command: “estat dwatson” (remember that you must have time- set your data to run a durbin watson test—tsset VarName) Or “dwstat” after you have generated a time variable and set it as a time series—”gen time = _n”  ”tsset time” STATA-Detecting Autocorrelation Compare the d-statistic to a durbin-watson table in order to determine your dl and du (I’ve included a table on the next slide)

Durbin-Watson Table ( α =0.05)

If d 4-d L treat as a problem (RED) If d L <d<d U or 4-d U <d<4-d L then inconclusive (YELLOW) If d U <d<4-d U treat as no problem (GREEN) Two-tailed test 20 dLdL dUdU d U 4-d L + exists- exists ? ? No +No -

Newey-West To run your regression with Newey corrected SE: Command: Newey dependvar independvars, lag(#)

Questions? Stop by the lab or with questions