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
Related Posts with Creating variables
Panel DataHello all, I want to do panel data analysis with stata. after i run this code: xtreg y(dependent var…
Creating categories of string variables from a continuous variableHello Stata users, I have a panel data set from survey data in long format that has to be kept conf…
mediation with threshold modelDear all i hope you are doing well i'd like to ask you if there is a way to deal with mediation ef…
abnormal stock returnsHi! I'm new to using stata and this website and i am trying to compute abnormal stock returns based …
Collapse comandDear all, I have a dataset with multiple variables on the firm and investor level over multiple yea…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables
Post a Comment