I have a survey dataset from several countries from a few time periods. Each country and period has its own variable (coded 0 and 1) which practically refers to the same thing. Variable A1 for example is only for individuals in country A in period 1. Variable A2 for country A, period 2, Variable B1 for country B, period 1, and so on. Since I want to combine the variables, I initially did something like:
Code:
egen combined = rowtotal(A1 A2 B1)
It wasn't my intention to add anything but I did so since I figured the other rows would be empty anyway. However, when I looked into the data browser, the observations with response "not applicable", "refusal", etc, also gave a value of 0.

My question is this: is there a way to combine these variables while still maintaining the "not applicable", "refusal", etc responses?