library(AER) #restringir salarios observados oursample <- subset(MROZ, !is.na(wage)) #estimar 2SLS ivreg1<-ivreg(log(wage)~educ+exper+I(exper^2)|motheduc+fatheduc+exper+I(exper^2), data=oursample) #teste Hausmann summary(ivreg1, diagnostics=TRUE)