library(plm); library(stargazer) #gerar estrutura de painel WAGEPAN.p <- pdata.frame(WAGEPAN, index=c("nr","year")) pdim(WAGEPAN.p) #verificar variação das variaveis pvar(WAGEPAN.p) #estimar modelos diferentes (sem reportar dummies de ano) WAGEPAN.p$yr<-factor(WAGEPAN.p$year) reg.MQO<-(plm(lwage~educ+black+hisp+exper+I(exper^2)+married+union+yr,data=WAGEPAN.p, model="pooling")) reg.fe<-(plm(lwage~educ+black+hisp+exper+I(exper^2)+married+union+yr,data=WAGEPAN.p, model="within")) reg.re<-(plm(lwage~educ+black+hisp+exper+I(exper^2)+married+union+yr,data=WAGEPAN.p, model="random")) stargazer(reg.MQO,reg.fe,reg.re, type="text", column.labels=c("MQO","FE","RE"), keep.stat=c("n","rsq"), keep=c("ed","bl","hi","exp","mar","un")) #teste Hausman phtest(reg.fe, reg.re)