My MWE looks like this:
Technically, what I am doing here are fixed-effects models, using the fact that reg ... i.rep78 gives the same as xtreg ... , fe.
What I would like is to add a row in the esttab output that displays for each estimation the p-value of a Hausman-Test, determining whether RE would give a better fit than FE.
How would I have to change the above code to achieve that? I guess I should use loops, i.e. looping through each variable mpg length weight, but I don't know if there is one result stored in r() that I can display, without displaying the estimators for the RE-models.
Code:
clear sysuse auto.dta gen time = _n xtset rep78 time estimates clear eststo: xi: reg price mpg i.rep78 eststo: xi: reg price length i.rep78 eststo: xi: reg price weight i.rep78 esttab * using output.tex, replace
What I would like is to add a row in the esttab output that displays for each estimation the p-value of a Hausman-Test, determining whether RE would give a better fit than FE.
How would I have to change the above code to achieve that? I guess I should use loops, i.e. looping through each variable mpg length weight, but I don't know if there is one result stored in r() that I can display, without displaying the estimators for the RE-models.
Comment