I'm currently working on a Gravity Model and I'm quite confused about how to properly set up the fixed effects model.
I have bilateral trade data in the following form:
Country_i | Country_j | Year | DepententVar | IndepententVar | PairID |
A | B | 2000 | 1232 | 2736 | AB |
A | B | 2001 | 1234 | 2536 | AB |
A | B | 2002 | 2716 | 2352 | AB |
B | C | 2000 | 3242 | 3435 | BC |
B | C | 2001 | 2342 | 2354 | BC |
B | C | 2002 | 2344 | 3345 | BC |
My understanding is, I have to use xtset and then xtreg instead of reg, because I have time values. So I set up:
Code:
xtset PairID Year, yearly
Code:
xtreg DependentVar IndependentVar i.Year, fe robust
Code:
xtreg DependentVar IndependentVar i.Country_i i.Country_j i.Year, fe robust
I searched the forum and the internet about how to set up fixed effects in a bilateral model (or gravity model) properly and came across the following code:
Code:
tab (Year), gen (Year_) egen expyear = group(Country_i Year) egen impyear = group(Country_j Year) tab(expyear), gen(expyear_) tab(impyear), gen(impyear_) xtreg DependentVar IndependentVar impyear_* expyear_* Year_*, robust
I assume the regression above would be for country fixed effects, so then only time fixed effects would be:
Code:
xtreg DependentVar IndependentVar Year_*, robust
Code:
xtreg DependentVar IndependentVar i.Country_i##i.Country_j i.Year, fe robust
I thought using i.Variable automatically treats the variable as a dummy, so I assume using Year_* instead of i.Year is the same, but Year_* is the "manual" way instead of the "automatic" way. Is this assumption right?
I'm confused which regressions are "right" when using fixed effects for the gravity model and where my errors in my first assumptions are. I hope someone could clarify this.
Any help is much apprechiated, thank you very much in advance!
0 Response to (Country) fixed effects for bilateral trade data in gravity model
Post a Comment