Dear everyone,
I have a dataset of 350 categorical variables, e.g: How satisfied are you with your life? 1. Unhappy .... 10. Very happy.
I want to do regression on them, but my professor advised me to convert them into dummy variables before doing it.
However, I only know one command to convert 1 categorical variable to dummy variable: tabulate varname, gen(newvarname). How could I convert such a large number of variables to dummy at once?
I also tried loop with foreach, but It was not correct.
Could you please kindly advised me?
Thank you very much!
Related Posts with Convert categorical variable to dummy variables in a large dataset
Interpretation of ROC regression resultsHi all, I performed ROC regressio using the rocreg command and I have the desired results. I know t…
Display FormatGreetings Everyone! Hopefully, you all be doing well, I have a question regarding the display forma…
three equations in structure model through "cmp"hello, I am trying to get the regression result of a structure model (which include three equations…
Disable auto-complete in do-file editorIs it possible to disable the do-file editor's auto-complete feature in Stata 17? If so, how? …
Counting string variables Year City Year Events 2018 London 2018 2 2018 London 2017 2 2017 London 2017 London …
Subscribe to:
Post Comments (Atom)
0 Response to Convert categorical variable to dummy variables in a large dataset
Post a Comment