Hello, I am running a gravity model.
My data looks something like this

Code:
use "http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA" if category!="TOTAL"
I have a panel with dyadic trade by sector (in this case category manuf- nonmanuf).
I would like to estimate the model accounting for sectoral differences in bilateral exports.
One way is to estimate the gravity model separately for manufactured good and non manufactured goods


egen imp = group(isoimp)
egen exp = group(isoexp)
eststo: ppmlhdfe trade fta if category == "MANUF", absorb(imp#year exp#year imp#exp) cluster(imp#exp)
eststo: ppmlhdfe trade fta if category == "NONMANUF", absorb(imp#year exp#year imp#exp) cluster(imp#exp)

[CODE]

egen imp = group(isoimp)
egen exp = group(isoexp)
eststo: ppmlhdfe trade fta if category == "MANUF", absorb(imp#year exp#year imp#exp) cluster(imp#exp)
eststo: ppmlhdfe trade fta if category == "NONMANUF", absorb(imp#year exp#year imp#exp) cluster(imp#exp)
esttab, se

[CODE]

However, I would like to estimate the model using all of the data including exporter-sector-year and importer-sector-year fixed effects. What is the correct way to implement this with ppmlhdfe?

I am thinking about something like this:

[CODE]

egen cat = group(category)
eststo: ppmlhdfe trade fta, absorb(imp#year#cat exp#year#cat imp#exp#cat) cluster(imp#exp)

[CODE]

Is this correct? in particular is it recommended also to cluster by dyad-category? moreover should I cluster the errors also on the category dimension?

If anyone has any suggestion, or warning against doing this type of analysis it would be most welcomed.