Hi, I want to create a dummy variable for whether an individual is a 1st or 2nd generation migrant. I am using 3 variables to do this:
Born in the country - which takes value 1 if yes and 2 if not
Mother born in the country - which takes 1 if yes and 2 if not
Father born in the country - which takes 1if yes and 2 if not
A first-generation migrant is defined as them or their parents being born elsewhere- the code I did for this was:
born in country * mother born in country* father born in country >=2 Which came out correct
However, I am struggling as a second-generation migrant. Here second-generation migrant is a native-born population with at least one parent being born elsewhere.
I tried the code:
Born in country==1 | Mother born in country * father born in country >=2
However this is not working
Any help to do this more effectively or correctly. Thank you
Related Posts with Generation dummy variable
T-test of difference between two regression coefficients within same modelHello, I have one single regression model estimating the coefficients (b) of two independent variab…
Stata Crashes while attempting collapseHello All, I run Stata SE 15.1 on a computer with 32 GB of RAM. I use Ubuntu as OS. And I have alre…
line graph at country and year level for several variables using levelsofHello all, I have a panel long format dataset that can be found attached containing year and countr…
Saving tabstat results in new variablesHello, I'm using tabstat to generate weighted standard deviations, by year, for two variables in a …
conditions by groupHi there, I have the following data and I want a variable that is 1 if, by firmid, there is at least…
Subscribe to:
Post Comments (Atom)
0 Response to Generation dummy variable
Post a Comment