# Is it possible to extract fixed effects in the fixed effects model in Stata?

Is it possible to extract fixed effects in the fixed effects model in Stata?

I know that in R I can do something like this with fixef command:

withinmodel <- plm(formula=y~x,data=Data, model="within")
summary(fixef(withinmodel))


But is it possible in Stata?

As an alternative you can also use the areg command which will give you the same estimated fixed effects as xtreg. Taking up the previous example:

webuse nlswork
areg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, a(idcode)
predict fe, d


There is a subtle difference between the two commands in terms of how the standard errors are treated when you cluster them. This might be relevant for the other parts of your analysis. areg adjusts the degrees of freedom according to the number of fixed effects that were absorbed. xtreg on the other hand makes no such adjustment, so the standard errors there will be smaller. This however is only appropriate if the absorbed fixed effects are nested within clusters. So if not all observations for any given group is in the same cluster you will be better off with areg.

The previous answer seems to be confusing fixed effects meta-analysis with a fixed effects panel data regression, which is what is being done in R.

In Stata you can obtain estimates of the fixed effects using the -predict- command

webuse nlswork
xtset idcode
xtreg ln_w grade age c.age#c.age ttl_exp c.ttl_exp#c.ttl_exp tenure c.tenure#c.tenure 2.race not_smsa south, fe
predict fe, u


See -help xtreg postestimation- for details.

Yes it is very simple to extract the summary estimate from a fixed-effects m-a in STATA.

You can put it in a local variable

e.g.

metan tsample tmean tsd csample cmean csd, fixed nograph // the "fixed" option is important here

local beta=_ES

local sebeta=_seES

Be sure to check out the help function - it has all this in it.

• Could you please explain a little bit more? What is the help function I need to check? Thanks in advance:) Jan 10, 2013 at 14:43
• Sure simply type "help metan" into the STATA command line and it will come up with pretty much all the info you need Jan 13, 2013 at 21:11
• I tried but when I type "help metan" I get the answer "help for metan not found"...But I found this stata.com/statalist/archive/2008-04/msg01015.html Jan 15, 2013 at 9:14