Hello,
I wanted to create an indicator variable combining two or more categorical variable. So for one of my variables i want to combine the variable gender (female=1 and male=0) and race (white=1, black=2, Hispanic=3 and other=4) to create 12 variables. Generally, when i create indicator variables using one categorical variable, i usually do one of the three options: manually generate variable or tabulate with generate ( ) or make a loop with the generate command. I tried to do this using 2 variables using the second or third method, but i kept getting an error from STATA. Is there an easy way to generate indicator variables using 2 or more categorical variables?
Related Posts with Creating indicator variables from multiple categorical variable
Does _parse comma have a bug with identifying unbound commas in compound quotes?I was surprised to discover that -graph- throws an error when the title (or various other strings) h…
Difference between instrumental variable interaction and instrumental variable subgroup analysisDear Statalist, For the following model under the IV framework: Code: ivreg2 cognition (infl_pneum…
identifying random slope by groupHi all, I have a multilevel logistic model (using melogit in Stata 15.1) written as: Code: melog…
ebalfit: New command for entropy balancingA new command for entropy balancing is now available from SSC. Type Code: . ssc install ebalfit to…
Help on storing estimates from multiple regressions run in loop for exporting them with esttabHello there, I have the following quarterly data. I intend to run a piecewise linear regression of …
Subscribe to:
Post Comments (Atom)
0 Response to Creating indicator variables from multiple categorical variable
Post a Comment