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
Help required for variable forecast procedureDear All I need some help with commands relating to earnings forecasts model: EARN(t+1)=b0+ b1EARN…
.ado Programming in Stata without invoking mata: Invalid Name error from within the functionStata Status: Beginner I have declared a local variable inside my function. And whenever I referenc…
Variable Significance Changes After Adding Regional DummiesDear All, I have two simple yet complicated question. I run my regressions on survey data using th…
Take the latest observation per fiscal-periodHi, I want to take (or mark) the latest forecast (variable= forecast_date) per fiscal-period (varia…
Difference in proportion adjusted for baseline characteristics (Mantel Haenszel method)Hi, I am analysing the results of a trial & would like to compare the proportion of individuals…
Subscribe to:
Post Comments (Atom)
0 Response to Generation dummy variable
Post a Comment