Examples / KLEIN.RPF |
KLEIN.RPF demonstrates estimation by two-stage least squares using the equations of Klein's Model I. See, for instance, Greene(2012), p 332 for a description of the model. This is a small (U.S.) macro model with three structural equations and three identities. The example file HANSEN.RPF also uses this model to demonstrate specification testing in instrumental variables models and GRN7P333.RPF in the Greene(2012) textbook examples estimates the model using a wide variety of other methods, such as three-stage least squares and Full Information Maximum Likelihood. (The SIMULEST.RPF example applies those to a different model).
The endogenous explanatory variables are (current) PROFIT, PRIVWAGE and PROD (production). The exogenous and pre-determined variables from the model are CONSTANT, TREND, the policy variables GOVTWAGE, GOVTEXP and TAXES and lags of CAPITAL, PROD and PROFIT. The instruments (the full list of exogenous and pre-determined variables) are listed on an INSTRUMENTS instruction. Note that you are required to include CONSTANT if it's appropriate (which it usually is).
instruments constant trend govtwage taxes govtexp $
capital{1} prod{1} profit{1}
The equations themselves are estimated by two-stage least squares using the LINREG instruction with the INSTRUMENTS option. Note that you do not need to do "two-stage" estimates yourself—all the required calculations are done by the LINREG.
linreg(inst) cons
# constant profit{0 1} wagebill
linreg(inst) invst
# constant profit{0 1} capital{1}
linreg(inst) privwage
# constant prod{0 1} trend
Full Program
calendar(a) 1920
open data klein.prn
data(format=prn,org=obs) 1920:1 1941:1
table
set wagebill = privwage + govtwage
set capital = klagged1+invst
set trend = year-1920
instruments constant trend govtwage taxes govtexp $
capital{1} prod{1} profit{1}
linreg(inst) cons
# constant profit{0 1} wagebill
linreg(inst) invst
# constant profit{0 1} capital{1}
linreg(inst) privwage
# constant prod{0 1} trend
Output
This is the output from the TABLE instruction, which shows basic statistics on the variables.
Series Obs Mean Std Error Minimum Maximum
YEAR 22 1930.5000000 6.4935866 1920.0000000 1941.0000000
CONS 22 53.3500000 7.3477402 39.8000000 69.7000000
PROFIT 22 16.7000000 4.2142615 7.0000000 23.5000000
PRIVWAGE 22 36.0181818 6.3601914 25.5000000 53.3000000
INVST 22 1.3318182 3.4797901 -6.2000000 5.6000000
KLAGGED1 22 199.5681818 10.6113321 180.1000000 216.7000000
PROD 22 59.3681818 10.8535878 44.3000000 88.4000000
GOVTWAGE 22 4.9863636 2.0083861 2.2000000 8.5000000
GOVTEXP 22 4.6863636 2.3807353 2.4000000 13.8000000
TAXES 22 6.6500000 2.1113638 3.4000000 11.6000000
These are the output from the three LINREG instructions for the three structural equations. These show summary statistics which are appropriate for two-stage least squares. In particular, there are no \(R^2 \) (which are only appropriate for least squares estimators) and there is a J-specification test.
Linear Regression - Estimation by Instrumental Variables
Dependent Variable CONS
Annual Data From 1921:01 To 1941:01
Usable Observations 21
Degrees of Freedom 17
Mean of Dependent Variable 53.995238095
Std Error of Dependent Variable 6.860865557
Standard Error of Estimate 1.135658590
Sum of Squared Residuals 21.925247348
J-Specification(4) 7.1007
Significance Level of J 0.1306592
Durbin-Watson Statistic 1.4851
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 16.554755765 1.467978697 11.27725 0.00000000
2. PROFIT 0.017302212 0.131204584 0.13187 0.89663371
3. PROFIT{1} 0.216234041 0.119221677 1.81371 0.08741342
4. WAGEBILL 0.810182698 0.044735057 18.11069 0.00000000
Linear Regression - Estimation by Instrumental Variables
Dependent Variable INVST
Annual Data From 1921:01 To 1941:01
Usable Observations 21
Degrees of Freedom 17
Mean of Dependent Variable 1.2666666667
Std Error of Dependent Variable 3.5519478224
Standard Error of Estimate 1.3071490861
Sum of Squared Residuals 29.046858465
J-Specification(4) 1.4693
Significance Level of J 0.8320728
Durbin-Watson Statistic 2.0853
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 20.27820894 8.38324890 2.41890 0.02707053
2. PROFIT 0.15022182 0.19253359 0.78024 0.44597984
3. PROFIT{1} 0.61594358 0.18092585 3.40440 0.00337550
4. CAPITAL{1} -0.15778764 0.04015207 -3.92975 0.00107972
Linear Regression - Estimation by Instrumental Variables
Dependent Variable PRIVWAGE
Annual Data From 1921:01 To 1941:01
Usable Observations 21
Degrees of Freedom 17
Mean of Dependent Variable 36.361904762
Std Error of Dependent Variable 6.304401335
Standard Error of Estimate 0.767155325
Sum of Squared Residuals 10.004963969
J-Specification(4) 10.1152
Significance Level of J 0.0385316
Durbin-Watson Statistic 1.9634
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.0659443264 1.1533129884 0.05718 0.95506996
2. PROD 0.4388590651 0.0396026616 11.08155 0.00000000
3. PROD{1} 0.1466738215 0.0431639485 3.39806 0.00342209
4. TREND 0.1303956872 0.0323883889 4.02600 0.00087642
Copyright © 2025 Thomas A. Doan