Code:
. sysuse nlsw88.dta (NLSW, 1988 extract) . graph box tenure wage, over(south)
I want to achieve something different. I want to have such a box plot one variable, but over two different variabes, such as
Code:
. sysuse nlsw88.dta (NLSW, 1988 extract) . graph box wage, over(south, c_city)
In my own dataset, I want to do this for the following reason: I have many different variables (psycho_1, psycho_2, psycho_3, psycho_4, ...) that attempt to explain facets of an overlying "construct" (psychopathy), and I want to quantify this construct by combining these variables into a one-dimensional thing (psychopathy score).
I would define the psychopathy score in slightly varying ways, such as
Code:
egen psychopathy_1 = psycho_1 + psycho_2 + psycho_3 + psycho_4 egen psychopathy_2 = 2*psycho_1 + psycho_2 + 3*psycho_3 + psycho_4
Code:
xtile psychquant_1 = psychopathy_1, nq(3)
The only way I can do that now would be
Code:
. graph box wage, over(psychquant_1) . graph box wage, over(psychquant_2)
Code:
. graph box wage, over(south) . graph box wage, over(c_city)
Comment