# Replicate a couple of Heckit analyses using Mroz's labor-market
# dataset (Econometrica, 1987): Table 22.7 in Greene's Econometric 
# Analysis (5e, 2003) and table 17.1 in Wooldridge's Econometric 
# Analysis of Cross Section and Panel Data (2002).
# 
# Note that Greene's estimates were subject to correction:
# http://pages.stern.nyu.edu/~wgreene/Text/Errata/ERRATA5.htm
# Our estimates should agree with the corrected version.

open mroz87.gdt

# generate quadratic terms and KIDS dummy
genr EXP2 = AX^2
genr WA2 = WA^2
genr KIDS = (KL6+K618)>0

# Greene's specification
list X = const AX EXP2 WE CIT
list Z = const WA WA2 FAMINC KIDS WE
heckit WW X ; LFP Z --two-step 
heckit WW X ; LFP Z 

# Wooldridge's specification
series NWINC = FAMINC - WW*WHRS
series lww = log(WW)
list X = const WE AX EXP2
list Z = X NWINC WA KL6 K618
heckit lww X ; LFP Z --two-step 
