Hello everyone,

I'm currently working with a balanced panel dataset on bilateral exports at the sector level (10 sectors) containing observations for 52*52 country pairs over a period of 21 years (total number of observations 535370).
What I try to find out is how free trade agreements (FTAs) affect the trade between each country pair in each sector, also accounting for the trade direction (e.g exports from country A to B in sector 1, or exports from country B to A in sector 1). Therefore, I constructed a total of 9040 FTA dummy-variables for each country-pair and each sector, also accounting for the trade direction. The dummy-variables are 1 if there is a FTA in place at time t and zero otherwiese. Also, I included 5-year lagged effects FTA dummies, being 1 if a FTA is in place at time t-5 and zero otherwise.
I tried to run a regression using the ppml_panel_sg command for the whole dataset, but since this was too much for my computer, I tried to loop the regression over sectors:

Code:
forvalues j=0/9 {
ppml_panel_sg exp_val1 dir1_sec`j'* dir2_sec`j'* dir3_sec`j'* lag5_dir1_sec`j'* lag5_dir2_sec`j'* lag5_dir3_sec`j'* if commoditycode=="`j'", exp(exp) imp(imp) ind(sector) y(year) tol(1e-7) maxiter(4300) verb(10) multi

}

Where:
j = sector
exp_val1=Value of export flows
dir1_sec`j'* = row of dummy-variables for whether a FTA is in place at time t in sector j for a country-pair
dir2_sec`j'* = row of dummy-variables for whether a country-pair is part of a trading block at time t in sector j
dir3_sec`j'* = row of dummy-variables for whether a country-pair is part of a customs union at time t in sector j
lag5...* = row of dummy variables for the 5-year lagged effects
I also accounted for exporter - sector - year and importer - sector - year fixed effects and three-way clustered the standard errors according to exporter - importer - year

Unfortunately I have some trouble with the regression:
i) Some of my direction FTA dummies get dropped due to "collinearity over lhs>0". I have checked the dummy variables and they seem to be correct. This means, that none of the FTA dummies should be perfectly collinear with another dummy variable. Does anyone of you have a clue why this could happen? I should also mention that I could not include intra-national trade observations due to missing data availability. Could that be a reason?

ii) The regression breaks after 10 iterations, showing the following error: "r(2000) no observations". I checked all of my dummy variables and they are neither string variables, nor contain any missing values. So maybe someone could help me to solve this issue. My only explanation would be that I have too less observations for when each dummy variable contains the value 1 (it could for example be that a dummy variable is 1 only for two observations out of the 535370 observations). Would that make sense?

Results:
__________________________________________________ __________________________
Initializing...
Checking for possible non-existence issues...
note: dir1_sec0_17 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_54 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_56 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_87 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_118 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_178 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir1_sec0_179 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_21 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_22 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_24 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_25 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_26 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_27 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_28 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_29 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_30 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_33 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_35 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_38 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_76 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_87 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_123 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_280 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_309 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_355 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_380 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_401 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir2_sec0_469 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir3_sec0_162 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir3_sec0_163 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: dir3_sec0_164 omitted because of collinearity over lhs>0 (creates possible
> existence issue)
note: lag5_dir1_sec0_17 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir1_sec0_52 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir1_sec0_54 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir1_sec0_56 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir1_sec0_87 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir1_sec0_118 omitted because of collinearity over lhs>0 (creates pos
> sible existence issue)
note: lag5_dir1_sec0_178 omitted because of collinearity over lhs>0 (creates pos
> sible existence issue)
note: lag5_dir1_sec0_179 omitted because of collinearity over lhs>0 (creates pos
> sible existence issue)
note: lag5_dir2_sec0_21 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_22 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_24 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_25 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_26 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_27 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_28 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_29 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_30 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_33 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_35 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_38 omitted because of collinearity over lhs>0 (creates poss
> ible existence issue)
note: lag5_dir2_sec0_401 omitted because of collinearity over lhs>0 (creates pos
> sible existence issue)
note: 69 observations dropped because they are perfectly predicted by excluded r
> egressors
(you may use the -keep- option if you would prefer to keep these observati
> ons)
Iterating...
iteration 1: diff = 1 coeffs = .6525654231 .3056020481 .291173
> 7009 .1277774201 .0982260606 .4987548639
iteration 10: diff = .9121821005 coeffs = .9497811448 .8731781361 .77065
> 13454 .5066650392 .3233281137 1.184266525
no observations
r(2000);

end of do-file

r(2000);
__________________________________________________ __________________________





Thanks in advance for your help!

Kind regards,
Philipp