Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re:st: FE over two columns


From   Christopher Baum <kit.baum@bc.edu>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   re:st: FE over two columns
Date   Mon, 24 Oct 2011 13:03:17 -0400

<>
This is probably a stupid question that can easily be done within Stata.
So I have a  gravity model with two columns containing the country names
(obviously).  I want to apply country fixed effects: which means the index
of the FE model is over two columns (ie. a country specific dummy should
be set to one regardless of whether it appears in column one or column
two).

I only have about 50 countries, so I can easily do this manually with
excel then push it into stata; but I thought I should learn how to do this
if Stata can do it internally.


If the two columns are labeled exporter and importer (as is usual in analyzing trade data)
you can't specify country fixed effects based on a country being either an X or an M, as the
dummies would not be mutually exclusive (e.g. both US->UK and UK->US contain each of those
countries). Usually with this sort of data you create fixed effects for all combinations, e.g.

egen exorem = group(exporter importer)
tsset exorem year  (or whatever is your time unit)

exorem will take on different values for each trade linkage.

Kit


Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
                             An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
  An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index