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
Generating random variables based on some predefined correlationsDear Stata Members I would like to ask a few questions and clear some doubts regarding regressions b…
LSDVC methodAfter regressions with LSDVC method stata indicates bootsraps error. I want to know what is differnc…
What should the command be?I would like to ask about the exact command. Assume yt= (infla t, unrate t, hwages t)is(3×1)-vector,…
Export Word putdocxHi I have not had Stata for too long and am trying to create a Word export from Stata. Unfortunatel…
Ytitle with euro sign does not display horizontallyDespite putting angle(0) the title will not be displayed horizontally. Since this only happens for t…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new variable, from specific values of 3 existing variables
Post a Comment