Estimate model parameters via two-step method
step2(YS, XS, YO, XO)
Selection vector.
Selection Matrix.
Interest vector.
Matrix of the equation of interest.
Returns a numerical vector with the parameter estimates of the Classical Heckman model via a two-step method. For more information see Heckman (1979)
James J Heckman (1979). “Sample selection bias as a specification error.” Econometrica: Journal of the econometric society, 153--161.
data(MEPS2001)
attach(MEPS2001)
#> The following objects are masked from PSID2:
#>
#> age, educ
#> The following objects are masked from data:
#>
#> age, educ, income
#> The following objects are masked from data3:
#>
#> age, educ, income
#> The following objects are masked from nhanes:
#>
#> age, educ, income
#> The following objects are masked from Mroz87 (pos = 7):
#>
#> age, educ
#> The following objects are masked from MEPS2001 (pos = 8):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 9):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 10):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from Mroz87 (pos = 11):
#>
#> age, educ
#> The following objects are masked from MEPS2001 (pos = 12):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 13):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 14):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
#> The following objects are masked from MEPS2001 (pos = 15):
#>
#> age, age2, agefem, ambexp, blhisp, dambexp, dhospexp, educ,
#> fairpoor, female, ffs, good, hospexp, income, ins, instype,
#> instype_s1, lambexp, lnambx, totchr, vgood, year01
YS <- dambexp
XS <- cbind(age, female, educ, blhisp, totchr, ins)
YO <- lnambx
XO <- cbind(age, female, educ, blhisp, totchr, ins, income)
step2(YS, XS, YO, XO)
#> XSage XSfemale XSeduc XSblhisp XStotchr XSins
#> 0.041950311 0.629046530 0.035839783 -0.458985308 0.785774049 0.182828788
#> XOage XOfemale XOeduc XOblhisp XOtotchr XOins
#> 0.450637479 1.262172664 0.182049809 -0.649939053 1.134936458 0.247641171
#> XOincome sigma rho
#> -0.002021763 2.620419828 1.639810343