It is trivial to convert a categorical variable into a bunch of dummy variables.
I would like to do the reverse...I have about 200 dummy variables which I would like to convert into a single categorical variable, so that I can easily run tab etc commands on it.
Any suggestions?
Alternatively, can I run some command on a group of dummies...which has the same effect as running tab on the categorical I would have obtained by combining the dummies.?
e.g.
I have dunmies cat1, cat2, cat3
The output I seek is:
cat1 : 45
cat2 : 36
cat3: 99
Related Posts with Combine a bunch of dummy variables into a multinomial/categorical
Stata 16: Multilevel mixed-effects linear regression model with random effectHi Stata users, In Stata 16, I am trying to fit a multilevel mixed-effects linear regression model b…
Categorizing values within a single variable via loopGood evening, I am new to Stata and have been researching and consulting the help command on a prob…
Interaction termsI am looking at how returns to education vary based on major selection. I am also interested in look…
Trouble reshaping panel data to long form when some variables are only measured in one wave/yearGreetings, I'm running Stata 15.1 on OSX and working with panel data (2011, 2012, 2016, 2017, 2018)…
Plotting longitudinal data by groupsDear Statalist, I have a dataset in long format: Code: * Example generated by -dataex-. To instal…
Subscribe to:
Post Comments (Atom)
0 Response to Combine a bunch of dummy variables into a multinomial/categorical
Post a Comment