Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Controlling for multiple fixed effects


From   Mark Schaffer <[email protected]>
To   [email protected], "Zoido, Pablo" <[email protected]>
Subject   Re: st: Controlling for multiple fixed effects
Date   Sun, 30 Nov 2003 19:35:45 +0000 (GMT)

Pablo,

Quoting "Zoido, Pablo" <[email protected]>:

> Hi,
> 
> I have a large dataset that contains purchases of different firms
> from
> different cities who buy from different kinds of providers at
> different
> times.  Say I want to run a regressions on the order's prices on the
> order's
> quantities and I want to control for differences across time, cities
> and
> kinds of providers by including fixed effects for each of these
> categories.
> I have a large number of fixed effect for each city and a kind of
> provider.
> 
> 
> How can I run such a regression without necessarily asking stata
> to
> calculate and include in the regression all of the dummy variables
> for each
> category.
> 
> If I use areg, or xtreg, fe I can only capture one fixed effect and
> the rest
> have to be included by brute force.
> 
> Is there anyway around this? Can I create a variable say
> fe=group(city time
> provider) and then use this for my xtreg, fe i(fe)?  Why not?

If I understand your problem correctly, then the answer is what you have 
just suggested.  You construct a variable fe that identifies uniquely the 
combination of city, time, and provider.  You then tell xtreg or areg that 
this is your fixed effect.  Should work fine.

--Mark

> 
> Thank you in advance for your help.
> 
> Pablo
> 
> ps: I am sure that many people must have confronted this problem. I
> am not
> sure I am making myself very clear. Basically, I have a lot of fixed
> effects
> to include in a regression that come from different sources, some
> times I
> even need an interaction effect.  The problem is I cannot use xi:
> because I
> have too many categories and dummies to create.
> 
> 
> *
> *   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/
> 



Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3008
email: [email protected]
web: http://www.sml.hw.ac.uk/ecomes
________________________________________________________________

DISCLAIMER:

This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom it is addressed.  If you are not the intended recipient
you are prohibited from using any of the information contained
in this e-mail.  In such a case, please destroy all copies in
your possession and notify the sender by reply e-mail.  Heriot
Watt University does not accept liability or responsibility
for changes made to this e-mail after it was sent, or for
viruses transmitted through this e-mail.  Opinions, comments,
conclusions and other information in this e-mail that do not
relate to the official business of Heriot Watt University are
not endorsed by it.
________________________________________________________________
*
*   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