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
how to graph pie like this?Array As above, how to draw the concentric circles? Code: * Example generated by -dataex-. To ins…
Count frequency of namesDear All, Suppose that I have this dataset, Code: * Example generated by -dataex-. To install: ssc…
how to get the coefficient of interation term after regression Code: xtset area_id year xtreg y i.dummy##c.GDP income xoijj i,year, fe r After running this r…
Problem with dummy variable in PMG modelHello, I'm running PMG model with one dummy veritable of (0 or 1) (xtpmg d.y d.x1 d.x2 d.x3 d.x4 DU…
Finding the sum of a variable within an ID is not workingHi all, For the following example data set below, I am trying to create a new variable (let's call …
Subscribe to:
Post Comments (Atom)
0 Response to Creating indicator variables from multiple categorical variable
Post a Comment