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.
Related Posts with Creating a new variable, from specific values of 3 existing variables
Coding Missing Values for a large set of variablesHi everyone, Im trying to code negative values in my dataset as missing values.i want to do this ac…
Collinearity with fixed effectsHello everyone, I have the following doubt, and would really appreciate any help. I am trying to q…
Common currency dummy should be zero with the same pair country?Hello to everyone. I am working in a gravity model with 133 countries from 2005 to 2018 and I am es…
Correction for multiple comparisons for combination of coefficients (lincom) on a multiple linear regression modelHi! I’m examining how the change in right ventricle systolic function (RVSF) between persons with ch…
Iteratively saving output to matrixHi all, I have one of the classic problems. Saving output from a regression to a matrix. I tried to…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable, from specific values of 3 existing variables
Post a Comment