Hello,
I am really bad in stata and need help. I have a database with 3 variables: birthcountry, authoritarian_mothercountry, authoritarian_fathercountry.
I want i generate a new variable that gives a 0 or a 1 if it matches with specific values from those 3 variables.
so:
gen authoritarian_parents== 1 if authoritarian_mothercountry or authoritarian_fathercountry ==1 & authoritarian_birthcountry == 0
So if the variable birthcountry == 0 and authorian_mothercountry or authoritan_fathercountry==1 then I want my new variable to take the value 1 for all observations, if not then I want it to have the value 0.
Thank you for any suggestions.
0 Response to Creating a new variable, from specific values of 3 existing variables
Post a Comment