* Heteroskedasticity in OLS Model for Compensation
*
* Keywords:
* regression, ols, linear, heteroskedasticity, glejser, test, compensation
*
* Description:
* We illustrate how to estimate a linear OLS Model for Compensation
* and use Glejser's Heteroskedasticity Test
*
* Author(s):
* Skif Pankov
*
* Source:
* Damodar N. Gujarati and Dawn C. Porter, Basic Econometrics - 5th Edition
* McGraw-Hill International Edition, Chapter 11, Example 11.2 (page 380)
*
sample 1 9
* Reading the datafile and naming variables
read(data_11.1.shd) comp prod
* Running an OLS regression of comp on prod, stating to include residual
* statistics and to save residuals in a variable reds
ols comp prod / rstat resid = reds
* Requiring to test the previous regression for heteroskedasticity
diagnos / het
* Generating absolute values of residuals
genr absu = abs(reds)
* Running an OLS regression of absu on prod, stating to include residual
* statistics
ols absu prod / rstat
stop