Dear All,
I am working on a bilateral data of the form;
exporter importer year trade
Germany France 2002 10000
I am trying to create a dummy following the pair of countries in the global and local sets below.
global EU "AUT BEL BGR CYP CZE DEU DNK ESP EST FIN FRA GBR GRC HRV HUN IRL ITA LTU LUX MLT NLD POL PRT ROU SVK SVN SWE CHE"
local ECOWAS "GHA BEN NGA BFA SEN CIV CPV GMB GIN GNB MLI NER TGO LBR SLE"
Hence I used the command;
foreach x of local EU & y of global ECOWAS {
gen DIV_EU=1 if exporter="x" & importer="y"
}
The above command seems not to work. Any suggestions
Related Posts with Using foreach for two set of groups
Loop to create new variablesDear All I am working on a data set where I have to create (project) variables for age and position…
interaction variable with i. operatorI want to run the following regression Code: reghdfe ABPROD BORDERLINE POST BORDERLINE_POST i.sic…
Creating a day variableI want to create a continuous day variable from January 1, 1991, to June 12, 1991. For instance, I e…
output from outreg2.Dear All, With given data, I run the following regressions and use (ssc install) outreg2 to construc…
Double loops in Stata?Dear All, I want to do the following: Code: local replace replace forvalues i = 2007(1)2017 { for…
Subscribe to:
Post Comments (Atom)
0 Response to Using foreach for two set of groups
Post a Comment