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
How to get residuals series of many regressions?Hello, I want to run 500 regression in one command. dependent series are Y1 to Y500 and three indepe…
Coefficient sign flips after applying Fixed EffectsGood day everybody, I am currently writing my master thesis and I research whether family owned com…
Robust Hausman TestHi, I was wondering if I have to run the Robust Hausman Test. Should I use the command 'xtoverid' o…
Adding lincom postestimation results to esttab regression tableDear Statalisters, I am trying to add some postestimation results from lincom to a regression table…
Customising maps or aggregating lower regions to large regions on a map- regions in the EUDear Statalist I am trying to cusotmise a map in stata. I have an EU map with regions at NUTS 2 Lev…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy variables with category names
Post a Comment