Dear Stata forum members,

I would like some help with the creation of certain variables.

The variables I already have are two categorical variables named 'vertical mismatch' and 'horiztonal mismatch'. Now I combined these two into the category of 'double mismatch' for observations having both a vertical and horizontal mismatch. The following code was used:

generate doublemismatch = 1 if vertical == 1 & horizontal == 1
replace doublemismatch = 0 if doublemismatch == .
label variable doublemismatch "doublemismatch"
label define doublemismatchl 1 "doublemismatch" 0 "other"
label values doublemismatch doublemismatchl

Now the issue that I have is that observations with a double mismatch are also still in the vertical and horiztonal categories. How do I prevent an observation that is considered a 'double mismatch' to be counted in the vertical or horizontal mismatch?

Thanks in advance,
Gavin