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
Funnel plots for one arm proportion meta analysisHi, I am performing an one-arm proportion metanalysis of incidence studies. Using this command "me…
Generating new variable - Qualtrics exportI am generating a new variable based on existing variables in my dataset which were exported from Qu…
How do you change frequency of dataThe data is currently monthly data. I would like to find the average of the 12 months into a yearly …
Checking for Assumptions before running a fe panel data model (Data Diagnostics)Hi, I am using panel data with 820 companies across 19 years (i.e. 15580 observations) and each obs…
how to generate weeks? . tab date_patologi Date of PA | examination | Freq. Percent Cum. ------------+-------------------…
Subscribe to:
Post Comments (Atom)
0 Response to Convert categorical variable to dummy variables in a large dataset
Post a Comment