Hi all,
I am dealing with a triple-dimension dataset (country, product and
year). It is China's imports from countries worldwide at 8-digit
level. To control for unobservable characteristics, I want to include
three sets of interactive fixed effects - country/product,
country/year and product/year - by using command xi: i.var1 * i.var2.
The problem is the number of product is huge, nearly 5000. I once let
Stata keep running for a whole night, but still nothing happened.
Is there any more efficient way to create double-interaction terms of
fixed effects?
If not, can I do the regression by simply de-meaning variables
relative to each fixed effects instead of including all these dummies?
Are following codes correct?
.foreach var of varlist y x {
bysort pcode ccode: egen m1`var' = mean(`var')
bysort year ccode: egen m2`var' = mean(`var')
bysort year pcode: egen m3`var' = mean(`var')
gen m`var' = `var' - m1`var' - m2`var' -m3`var'
}
.reg my mx, robust
Any advice will be highly appreciated!
Thanks and with best regards,
Yandi
--
Yours.
Ms. Yandi SHEN
Mobiel: +39-3891519209
*
* 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/