Hello everyone!

We are stuck with a problem creating a new dummy variable from a data with many dummy variables. Our dataset is taken from CEPII and there, trade statistics of many countries is saved. What we want to create is a dummy variable in which there is =1 when EU countries trade with South Africa, and when South Africa trade with EU countries.

The four conditions that we want to include from our dataset is when following variables are =1:
EU_o =1
EU_d =1
ZAF_o =1
ZAF_d =1

The idea here is to exclude all other countries from this dummy variable. We have tried by doing: gen ZAFFTA_n= 1 if ID1 == 87 & EU_o == 1 & id3 == 189 & EU_d == 1
and by trying to make it individually by gen onlyEU=1 if EU_o==1 & id3==189.

In these cases, no changes are made. Is it possible to do this based on these conditions?

Thank you very much,

best regards