Statalist


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

st: RE: two-way fixed effects


From   "Johnson, Eric A. (Seattle)" <[email protected]>
To   <[email protected]>
Subject   st: RE: two-way fixed effects
Date   Tue, 24 Jun 2008 15:10:47 -0700

1)
. egen dummy = group(firm year)
. xi: reg quantity price i.dummy

and 2)
. xi: reg quantity price i.firm i.year


These two commands don't generate equivalent design matrixes; the egen
command incorporates interaction effects between firm and year, while
the second model does not include them.  Beyond that, I can't help you:
the use of interaction terms should come from scientific knowledge.  (in
my opinion, of course!)

Hope that helps!
Eric


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Wang
Sent: Tuesday, June 24, 2008 12:30 PM
To: statalist
Subject: st: two-way fixed effects

Dear Statalist,

I have an old question, which command should I use for two-way fixed
effects? For example if I want to control both year and firm fixed
effects. I find two methods as follows:
1)
. egen dummy = group(firm year)
. xi: reg quantity price i.dummy

and 2)
. xi: reg quantity price i.firm i.year

I find the two methods gave the same estimation of coefficient, but
method 2) seems to yield a large t-stat. Could someone please advise
which one should I use?

Many thanks!

Martin



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



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