Hi within a dataset I have been looking at there are 33 countries. I am trying to create a dummy variable for a UK native and a UK migrant. I'm wondering how I would create this variable. I have two variables that may help to do this. One is the Country name itself. Then there is a variable for country of birth.
I thought using both variables I could create a dummy variable for UK migrants and UK natives.
For UK natives I thought the command is:
gen UKnative = Country==UK | Country of birth==UK
So I want to create a UK native dummy variable which = 1 if the individual is a native in the UK
But I am struggling to do this for a UK migrant since there are many other countries. Would it be:
gen UKmigrant = Country==UK | Country of birth not = UK.
So I want to create a UK migrant dummy variable which =1 if the individual is a migrant in the UK
I am not sure how to do this
Related Posts with Generating new variable
Omitted "Treatment" variable in DiD fixed panel regressionOmitted "Treatment" variable in DiD fixed panel regression 01 May 2021, 08:30 Hi, I'm currently stu…
Quadratic moments condition in GMMHi all, I am trying to evaluate a framework which requires me to input a quadratic GMM condition. I…
Plotting using survey weightsI have responses of survey on students and the data needed to be weighted based on the faculty of th…
Short Deadline: Help with xtreg regressionHello, I am facing a problem with my panel data which has "loans disbursed" as a panel variable and…
Stata 17 Bookmarks Not Working and No Navigation ControlAfter creating bookmarks in Stata 17.0, I am not provided a Navigation Control by which I can naviga…
Subscribe to:
Post Comments (Atom)
0 Response to Generating new variable
Post a Comment