|
Examples / INSTRUMENT.RPF |
INSTRUMENT.RPF is an example of estimation using two-stage least squares. It is based upon example 9.5 from Wooldridge(2010).
It estimates labor supply and labor demand functions using 2SLS. The HOURS and LWAGE (log wage) variables are assumed to be endogenous. EDUC, AGE, KIDSLT6, KIDSGE6, NWIFEINC, EXPER and EXPERSQ (experience and its square) are assumed to be exogenous and enter the hours or wage equation or both. EXPER and EXPERSQ are excluded from the hours equation. AGE and the family variables (KIDSLT6, KIDSGE6, NWIFEINC) are assumed not to directly affect the wage equation.
The program first does least squares, which is (under the assumptions) an inconsistent estimator because it has the endogenous LWAGE variable among its explanatory variables.
linreg hours
# constant lwage educ age kidslt6 kidsge6 nwifeinc
This sets the instrument set to the full list of exogenous variables and estimates the hours equation by 2SLS:
instruments constant educ age kidslt6 kidsge6 nwifeinc $
exper expersq
linreg(instruments) hours
# constant lwage educ age kidslt6 kidsge6 nwifeinc
It next checks the reduced form for LWAGE and sees if the instruments excluded from the labor demand function (EXPER and EXPERSQ) work. If the coefficients on these are effectively zero, we have a weak set of instruments. This is true even if the \(R^2\) on the reduced form is high, since that can be high because of the correlation with the variables already included in the regression.
linreg lwage
# constant educ age kidslt6 kidsge6 nwifeinc exper expersq
It repeats the process for the wage equation. In this case, the variables of interest in the reduced form regression are the three family variables.
linreg(instruments) lwage
# constant hours educ exper expersq
linreg hours
# constant educ age kidslt6 kidsge6 nwifeinc exper expersq
Full Program
open data mroz.raw
data(format=free,org=columns) 1 428 inlf hours kidslt6 kidsge6 $
age educ wage repwage hushrs husage huseduc huswage faminc mtr $
motheduc fatheduc unem city exper nwifeinc lwage expersq
*
set lwage = log(wage)
set expersq = exper^2
*
* Estimate the labor supply function by OLS
*
linreg hours
# constant lwage educ age kidslt6 kidsge6 nwifeinc
*
* Now by 2SLS
*
instruments constant educ age kidslt6 kidsge6 nwifeinc exper expersq
linreg(instruments) hours
# constant lwage educ age kidslt6 kidsge6 nwifeinc
*
* Check the reduced form for log(wage) and see if the instruments
* excluded from the labor demand function (exper and expersq) work.
*
linreg lwage
# constant educ age kidslt6 kidsge6 nwifeinc exper expersq
*
* Estimate the wage equation by 2SLS
*
linreg(instruments) lwage
# constant hours educ exper expersq
*
* Estimate the reduced form for hours.
*
linreg hours
# constant educ age kidslt6 kidsge6 nwifeinc exper expersq
Output
Linear Regression - Estimation by Least Squares
Dependent Variable HOURS
Usable Observations 428
Degrees of Freedom 421
Centered R^2 0.0669555
R-Bar^2 0.0536579
Uncentered R^2 0.7559876
Mean of Dependent Variable 1302.9299065
Std Error of Dependent Variable 776.2743846
Standard Error of Estimate 755.1606057
Sum of Squared Residuals 240082634.54
Regression F(6,421) 5.0352
Significance Level of F 0.0000531
Log Likelihood -3440.1030
Durbin-Watson Statistic 2.0119
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 2114.697261 340.130657 6.21731 0.00000000
2. LWAGE -17.407807 54.215441 -0.32109 0.74830472
3. EDUC -14.444861 17.967928 -0.80392 0.42189418
4. AGE -7.729976 5.529450 -1.39796 0.16285971
5. KIDSLT6 -342.504820 100.005935 -3.42484 0.00067551
6. KIDSGE6 -115.020514 30.829253 -3.73089 0.00021696
7. NWIFEINC -4.245807 3.655815 -1.16138 0.24614357
Linear Regression - Estimation by Instrumental Variables
Dependent Variable HOURS
Usable Observations 428
Degrees of Freedom 421
Mean of Dependent Variable 1302.9299065
Std Error of Dependent Variable 776.2743846
Standard Error of Estimate 1301.9109282
Sum of Squared Residuals 713583239.40
J-Specification(1) 0.8441
Significance Level of J 0.3582171
Durbin-Watson Statistic 2.0752
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 2432.197739 594.171843 4.09342 0.00005097
2. LWAGE 1544.818465 480.738717 3.21343 0.00141249
3. EDUC -177.448956 58.142594 -3.05196 0.00241750
4. AGE -10.784086 9.577347 -1.12600 0.26080729
5. KIDSLT6 -210.833886 176.933971 -1.19160 0.23409083
6. KIDSGE6 -47.557076 56.917855 -0.83554 0.40388834
7. NWIFEINC -9.249121 6.481116 -1.42709 0.15429581
Linear Regression - Estimation by Least Squares
Dependent Variable LWAGE
Usable Observations 428
Degrees of Freedom 420
Centered R^2 0.1640984
R-Bar^2 0.1501667
Uncentered R^2 0.7749748
Mean of Dependent Variable 1.1901732988
Std Error of Dependent Variable 0.7231978174
Standard Error of Estimate 0.6666900483
Sum of Squared Residuals 186.67976061
Regression F(7,420) 11.7788
Significance Level of F 0.0000000
Log Likelihood -429.7438
Durbin-Watson Statistic 1.9664
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant -0.357997157 0.318296322 -1.12473 0.26134618
2. EDUC 0.099884364 0.015097463 6.61597 0.00000000
3. AGE -0.003520395 0.005414522 -0.65018 0.51593369
4. KIDSLT6 -0.055872531 0.088603436 -0.63059 0.52865093
5. KIDSGE6 -0.017648449 0.027890988 -0.63277 0.52723128
6. NWIFEINC 0.005694220 0.003319524 1.71537 0.08701446
7. EXPER 0.040709747 0.013372257 3.04434 0.00247855
8. EXPERSQ -0.000747327 0.000401777 -1.86005 0.06357660
Linear Regression - Estimation by Instrumental Variables
Dependent Variable LWAGE
Usable Observations 428
Degrees of Freedom 423
Mean of Dependent Variable 1.1901732988
Std Error of Dependent Variable 0.7231978174
Standard Error of Estimate 0.6850200576
Sum of Squared Residuals 198.49379877
J-Specification(3) 2.9065
Significance Level of J 0.4062705
Durbin-Watson Statistic 2.0024
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant -0.692790020 0.306600206 -2.25959 0.02435492
2. HOURS 0.000160806 0.000215408 0.74652 0.45576691
3. EDUC 0.111117504 0.015331869 7.24749 0.00000000
4. EXPER 0.032645976 0.018061015 1.80754 0.07138863
5. EXPERSQ -0.000676540 0.000442636 -1.52844 0.12715173
Linear Regression - Estimation by Least Squares
Dependent Variable HOURS
Usable Observations 428
Degrees of Freedom 420
Centered R^2 0.1403082
R-Bar^2 0.1259800
Uncentered R^2 0.7751710
Mean of Dependent Variable 1302.9299065
Std Error of Dependent Variable 776.2743846
Standard Error of Estimate 725.7314489
Sum of Squared Residuals 221208177.06
Regression F(7,420) 9.7925
Significance Level of F 0.0000000
Log Likelihood -3422.5809
Durbin-Watson Statistic 2.0298
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 2056.642761 346.484324 5.93575 0.00000001
2. EDUC -22.788406 16.434479 -1.38662 0.16629267
3. AGE -19.663522 5.894026 -3.33618 0.00092493
4. KIDSLT6 -305.720873 96.450067 -3.16973 0.00163748
5. KIDSGE6 -72.366728 30.360986 -2.38354 0.01759038
6. NWIFEINC 0.443852 3.613498 0.12283 0.90229924
7. EXPER 47.005088 14.556491 3.22915 0.00133910
8. EXPERSQ -0.513644 0.437358 -1.17443 0.24088981
Copyright © 2025 Thomas A. Doan