* Specification Tests on OLS Regression for Hourly Wages
*
* Keywords:
* regression, log, ols, specification, test, f-test, omitted, variable,
* heteroskedasticity, white, errors, jarque-berra, hourly, wage
*
* Description:
* We illustrate how to estimate Log-Linear and Polynomial OLS Models for
* Hourly Wages and apply Specification Tests on them, including Omitted
* Variable, Heteroskedasticity and Jarque-Berra Normality Tests, and create
* histograms and graphs of residuals
*
* Author(s):
* Skif Pankov
*
* Source:
* Damodar N. Gujarati and Dawn C. Porter, Basic Econometrics - 5th Edition
* McGraw-Hill International Edition, Chapter 13, Example 13.11-1 (page 500)
*
sample 1 1289
* Reading the datafile and naming variables
read(data_13.11-1.shd) wage fe nw un edu exp wk
* Generating the log of wages, interraction dummy variables and a square of
* experience
genr lnwage = log(wage)
genr fenw = fe*nw
genr feun = fe*un
genr fewk = fe*wk
genr exp2 = exp**2
* Running an OLS regression of lnwage on original variables, stating to
* include residual statistics
ols lnwage edu exp fe nw un wk / rstat
* Running a modified version of the previous OLS regression by including
* interraction dummy variables - regression is run in order to test the
* joint significance of the inluded dummy variables
ols lnwage edu exp fe nw un wk fenw feun fewk
* Conducting an F-test of the joint significance of interraction dummies
test
test fenw = 0
test feun = 0
test fewk = 0
end
* Including the square of the exp variable into the first regression
* to test the linearity of the exp
ols lnwage edu exp fe nw un wk exp2 / rstat
* Testing the previous OLS regression for heteroskedasticity
diagnos / het
* Running the previous OLS regression with White's heteroskedasticity
* corrected standard errors, saving residuals, predicted values and testing
* for normality of residuals using Jarque-Bera test
ols lnwage edu exp fe nw un wk exp2 / rstat hetcov resid = reds predict = elnwage gf
* Creating a histogram of residuals from previous regression, stating to
* use 30 histogram groups
graph reds / histo range groups = 30
* Creating a graph of reds against elnwage
graph reds elnwage
* Showing descriptive statistics of variables wage, edu and exp
stat wage edu exp / all
* Testing wage, edu and exp for normality using Jarque-Bera test
ols wage / gf
ols edu / gf
ols exp / gf
stop