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
Replace missing values from a different rowI have data that are in long format where one ID has four rows of data. Only one row has information…
How to sort data for distinct IDs with multiple visits and multiple valuesDear all, I have a dataset that has multiple visits for each person. However each person had a diff…
Panel VECM in STATA I am giving a general description of the model in a panel setting: Let y, a, b, and z are four vari…
Code for Marginsplot Interaction Terms - Error/questionsHi all, I am trying to determine whether the effect of income (continuous var) on cash usage depend…
Bootstrapped SE with Two-Sample IV: "insufficient observations to compute bootstrap standard errors"I am not sure if this is kosher but I am trying to calculate bootstrapped standard errors for a two-…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variables
Post a Comment