library(AER)
data(CollegeDistance)
wage_mod_1 <- lm(log(wage) ~ education, data = CollegeDistance)
wage_mod_2 <- lm(log(wage) ~ unemp + ethnicity + gender + urban + education, data = CollegeDistance)
wage_mod_iv1 <- ivreg(log(wage) ~ education | distance, data = CollegeDistance) wage_mod_iv2 <- ivreg(log(wage) ~ unemp + ethnicity + gender + urban + education | . - education + distance, data = CollegeDistance)
# todos los objetos del modelo de los ejercicios anteriores están disponibles en el entorno global