Dear all,
I have a dataset comprising thousands of individuals. For each individual I have, among others, region of residence (there are 9 overall) and marital status.
I am required to create a dummy for each region and each should be called like the corresponding region. I have tried the following code:
dummies region
rename region1 Pacific
rename region2 East_South
rename region3 West_South
rename region4 Mountain
rename region5 New_England
rename region6 South_Atlantic
rename region7 West_North
rename region8 East_North
rename region9 Middle_Atlantic
However, I was looking for a more compact way to do this, given that I must create a new variable including all the regional dummies as well as marital status.
Thank you in advance,
Best regards,
AC
Related Posts with Creating dummy variables with category names
Panel Data Estimator ConfusionHi Statalist, I'm currently attempting to look at the impact of different variables on democracy. I…
Synthetic Control Aggregating Data from firm levelMy question is focused on finding the effect of the Brexit vote on the profitability of UK banks. I …
How to specify family-level option for psmatch2 (my data is at the child-level)Hi everyone, first post so pardon me if I'm making a rookie mistake. I want to compare the differen…
Droping outliers based on different criteriaDear all, I use Stata 13 and I want to calculate average value of X removing outliers (1st and 99th…
How to deal with a difference in difference fixed effects model with a discrete treatment variable?Hi, I am trying to conduct a fixed effects difference in difference model to estimate the effect of …
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy variables with category names
Post a Comment