* Linear WLS Model for Compensation
*
* Keywords:
* regression, weights, wls, linear, heteroskedasticity, compensation,
* employment size
*
* Description:
* We illustrate how to estimate a Linear Weighted Least Squares (WLS) Model
* for Compensation and Employment Size
*
* Author(s):
* Skif Pankov
*
* Source:
* Damodar N. Gujarati and Dawn C. Porter, Basic Econometrics - 5th Edition
* McGraw-Hill International Edition, Chapter 11, Example 11.7 (page 390)
*
sample 1 9
* Reading the datafile and naming variables
read(data_11.7.shd) comp empl sig
* Generating weights which shall later be used in the WLS regression
genr w = 1/sig
* Running a WLS regression of y on x, using w as weights
ols comp empl / weight = w
* Running an OLS regression of y on x
ols comp empl
stop
* Note:
* parameter estimates of the WLS regression will differ from those in the
* book due of different levels of accuracy when applying weights