Hello!

I am trying to create a dummy that equals one whenever one of two chosen dummies equals one, no matter if one of them is missing. However, I want to avoid stata to generate a zero if both are missing, because in that case I want to return a missing value.

for now, I did it like this:

Code:
generate SME2 = SME2011 == 1 | SME2012 == 1
however, stata returns a zero even if both values are missing. If I add the condition if SME2011 != . & SME2012 != . stata returns a missing value from the moment one of them is missing, but I only want to return a . if both are missing.

kind regards,
Timea