I am trying to figure out how to estimate a Type II Tobit/Heckman/heckit model in R and extract heteroskedasticity robust standard errors. It would be nice if the standard errors were robust for both stages of estimation, but the final one is my primary concern.
The standard package for estimating Heckman/heckit models in R seems to be sampleSelection
, which I use below. The usual packages, sandwich
and lmtest
, do not have support for this type of model.
Here is the minimum reproducible example to estimate the model:
library(sampleSelection)
library(wooldridge)
d <- wooldridge::mroz
heck_fit <- heckit(
selection = inlf ~ educ + nwifeinc + age + kidslt6,
outcome = lwage ~ educ + nwifeinc + age,
data = d,
method = "ml")
summary(heck_fit)
I can extract the constant-variance standard errors for the model with vcov(heck_fit)
and only for the outcome regression with vcov(heck_fit, part = "outcome")
, but I do not know how to get heteroskedasticity robustness. I have played around with vcovHC()
and coeftest()
and they both fail.
Heteroskedasticity-robustness is never mentioned in the documentation for sampleSelection
either. broom
and many other regression analysis packages do not seem to support these models.
I'll note that heck_fit
is equivalent to the following in Stata:
heckman lwage educ nwifeinc age, select(educ nwifeinc age kidslt6)
The standard errors are equal to the 5th decimal place.
However, I would like to be estimating the R equivalent of this in Stata:
heckman lwage educ nwifeinc age, select(educ nwifeinc age kidslt6) vce(robust)
If you are testing, here are the standard errors for the outcome equation.
The normal standard errors per Stata and R are educ = .017882, nwifeinc = .003657, and age = .004631.
Whereas, per Stata, the heteroskedasticity robust standard errors are educ = .0198926, nwifeinc = .0037428, age = .0049529.
Thank you for your help!