You are on page 1of 2

Panel Logit Models:

xtset idcode year

/*Fixed effects*/

xtlogit emplyed msp c_city ind_code occ_code ttl_exp hours wage, fe

/*Random effects*/

xtlogit emplyed msp c_city ind_code occ_code ttl_exp hours wage, re

/*Hausman test*/

hausman fe re

/*So we have to use the fixed effects model as shown below*/


xtlogit emplyed i.msp i.c_city i.ind_code i.occ_code c.ttl_exp c.hours c.wage, fe

/*You can control the reference categories as shown below*/

xtlogit emplyed i.msp i.c_city ib4.ind_code ib3.occ_code c.ttl_exp c.hours


c.wage, fe

/*Yet use the fixed effects model as shown below*/


xtlogit emplyed i.msp i.c_city i.ind_code i.occ_code c.ttl_exp c.hours c.wage, fe

/*it’s helpful to have the odds ratios*/

xtlogit, or

/*Predicting yhat and probabilities*/

predict yhat

gen estimor=exp(yhat)
gen probyhat=estimor/(1+estimor)

/*Pooled OLS model*/

logit emplyed i.msp i.c_city i.year i.ind_code i.occ_code c.ttl_exp c.hours


c.wage, vce(cluster idcode)

/*i.ind_code is NOT Significant, but if you use as below it may change*/

logit emplyed i.msp i.c_city i.year ib2.ind_code i.occ_code c.ttl_exp c.hours


c.wage, vce(cluster idcode)

/*Nested logistic regressions*/

nestreg: logit emplyed (msp c_city year) (ind_code occ_code) (ttl_exp hours
wage)

/*Stata Commands for Making Publication-Quality Tables. You can run these
models one by one, if you want to create a publishable table as shown below*/

outreg2 using pooledlogit1, e(ll chi2) addstat(Pseudo R-squared, `e(r2_p)')


dec(3) word replace

outreg2 using pooledlogit1, e(ll chi2) addstat(Pseudo R-squared, `e(r2_p)')


dec(3) word append

outreg2 using pooledlogit1, e(ll chi2) addstat(Pseudo R-squared, `e(r2_p)')


dec(3) word append

You might also like