# Replicate parts of Table 4 in Arellano and Bond,
# "Some Tests of Specification for Panel Data: Monte Carlo 
# Evidence and an Application to Employment Equations",
# Review of Economic Studies, 58 (1991), pp. 277-297.

open abdata.gdt

# Take first differences of the independent variables
genr Dw = diff(w)
genr Dk = diff(k)
genr Dys = diff(ys)

# We first treat all the independent variables as
# exogenous (Table 4, column b)

# 1-step GMM estimation
arbond 2 ; n Dw Dw(-1) Dk Dys Dys(-1) 0 --time-dummies
# 2-step estimation
arbond 2 ; n Dw Dw(-1) Dk Dys Dys(-1) 0 --time-dummies --two-step

# Then we treat the wage and capital stock as predetermined,
# not exogenous.  This gives an approximation to Table 4,
# column c.  But note that some of the data used in that
# model are not available.  In addition, we're using
# finite-sample corrected standard errors.

list pred = Dw Dw(-1) Dk
list exog = Dys Dys(-1) 0
arbond 2 ; n pred exog ; exog GMM(k,2,3) GMM(w,2,3) --time-dummies
arbond 2 ; n pred exog ; exog GMM(k,2,3) GMM(w,2,3) --time --two-step

