# st: RE: Two-way fixed effects

 From "Nick Cox" To Subject st: RE: Two-way fixed effects Date Sat, 26 Jun 2004 13:39:15 +0100

```Tim Sass started a thread on a loosely similar
may appear here.

Nick
n.j.cox@durham.ac.uk

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu]On Behalf Of Bob Bifulco
> Sent: 25 June 2004 16:33
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Two-way fixed effects
>
>
> I am working with a panel dataset and have tried 4 ways to
> estimate a two
> way fixed effect that controls for year and group fixed
> effects. (Hopefully
> you can follow my notation)
>
> egen Yi.=mean(Yit), by(group);
> egen Y..=mean(Yit);
> egen Y.t=mean(Yit), by(year);
>
> (1)  xi: xtreg y x i.year, i(group) fe;
>
> (2)  reg y* x* year1* year2* . . . year5*;
> 	where y*=Yit-Yi.+Y.. and other * variables defined similarly)
>
> (3)  reg y** x** year1** year2** . . . year5**, noconstant;
> 	where y**=Yit-Yi. and other ** variables defined similarly
>
> (4)  reg y*** x***, no constant;
> 	where y***=Yit-Yi.-Y.t+Y.. and x*** defined similarly
>
> (1) and (2) provide very similar, but exactly the same, coefficient
> estimates.  The estiamtes produced by (3) and (4)are both
> different from
> each other and different from (1) and (2).  Can anyone
> explain why each of
> these do not provide the same coefficient estimates.
>
> *
> *   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/
>

*
*   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/
```