# \donttest{
# Data
library("AER")
data("PSID1976")
PSID1976$lfp <- as.numeric(PSID1976$participation == "yes")
PSID1976$kids <- with(PSID1976, factor((youngkids + oldkids) > 0,
levels = c(FALSE, TRUE),
labels = c("no", "yes")))
# IV probit model by MLE
# (nwincome is endogenous and heducation is the additional instrument)
PSID1976$nwincome <- with(PSID1976, (fincome - hours * wage)/1000)
fiml.probit <- ivpml(lfp ~ education + experience + I(experience^2) + age +
youngkids + oldkids + nwincome |
education + experience + I(experience^2) + age +
youngkids + oldkids + heducation,
data = PSID1976)
summary(fiml.probit)
# }
Run the code above in your browser using DataLab