Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: suest with large number of fixed effects


From   "Schaffer, Mark E" <[email protected]>
To   <[email protected]>
Subject   st: RE: suest with large number of fixed effects
Date   Wed, 12 Sep 2007 19:00:11 +0100

Richard,

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Richard Boylan
> Sent: Wednesday, September 12, 2007 4:11 PM
> To: [email protected]
> Subject: st: suest with large number of fixed effects
> 
> I would like to estimate several regressions separately, but 
> using suest to obtain more precisely estimate coefficients
> 
> So, what I would like to do is:
> 
> xtreg y1 x1, i(id) fe
> est store eq1
> xtreg y2 x2, i(id) fe
> est store eq2
> xtreg y3 x3, i(id) fe
> est store eq3
> suest eq1 eq2 eq3, cluster(id)
> 
> Given that xtreg does not have a score option, it is 
> discussed in previous postings that one needs to estimate the 
> model using a linear regression with dummy variables.
> 
> The problem I have is that I have 1000 fixed effects and thus 
> the matrix computed in suest is going to be way too large.

First, there is a misunderstanding here.  -suest- does not give you more
"precisely estimated coefficients".  They will be *exactly* the same.
What is different is the SEs, and in particular, the var-cov matrix will
allow you to test cross-equation restrictions.

To get more efficient estimates of the coefficients, you would need to
use Zellner's SUR ("seemingly-unrelated regressions") estimator,
available in Stata as -sureg-.

Second, and somewhat more constructively, since you are in
fixed-effects-land, you can demean your variables by hand to wipe out
the fixed effects (the "within" transformation) and then estimate using
-regress- or -sureg-.  This gives you two options: (a) estimate using
-regress- and then combine the results with -suest-; (b) estimate using
-sureg-.

(a) is robust but won't give you more efficient estimates of the
coefficients.  (b) is more efficient but assumes homoskedasticity.

Moreover, the var-cov estimator in (b) will be wrong, because it won't
have adjusted for the degrees of freedom lost to the fixed effects.
Basically, you would need to adjust the vcv matrix by hand, so that
instead of K being the number of regressors in an eqn, it's the number
of regressors + number of fixed effects.

Below is some code that compares the two approaches but doesn't do the
dof adjustment.

Hope this helps.

Cheers,
Mark

***** suest vs sureg in a fixed effects model *****

sysuse abdata, clear
sort id
* Use Ben Jann's -center- command to demean.
* Make sure that the estimation sample is consistent ("casewise")
by id: center ys k n, casewise
by id: center indoutpt cap emp, casewise

* Compare xtreg,fe and demeaned - should be the same
xtreg ys k n, i(id) fe
reg c_ys c_k c_n, nocons
xtreg indoutpt cap emp, i(id) fe
reg c_indoutpt c_cap c_emp, nocons

* suest - combine eqns but with same point estimates.  Cluster on firm.
* Does not require dof adjustment for fixed effects
qui reg c_ys c_k c_n, nocons
est store eqn1
qui reg c_indoutpt c_cap c_emp, nocons
est store eqn2
suest eqn1 eqn2, cluster(id)

* sureg - Zellner's seemingly-unrelated eqns estimator.
* More efficient, different point estimates, but assumes
homoskedasticity
* Note SEs are wrong because the dofs don't account for the 140 fixed
effects
sureg (c_ys c_k c_n, nocons) (c_indoutpt c_cap c_emp, nocons)

*****************************************************

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index