I'm doing a histogram of continuous variable (quallife), discrete by two categories in a binary variable (gender), this is my code (so it looks like two histograms next to each other):
histogram quallife, discrete by(gender)
It produces a nice histogram but I want to relabel the groups so that they don't appear as 1 and 2, but instead as 'male' and 'female'.
I tried this but STATA says 'option relabel not allowed':
histogram quallife, discrete by(gender, relabel(1"Male" 2 "Female"))
I somehow did this correctly at some point but accidentally lost my code and I've been going crazy for days trying to figure out how to do it!
Any help is really appreciated
Thank you
Related Posts with How to label discrete variables on histogram
Creating interaction terms between a group of year dummies and a group of product dummies and how to use them in a regression equation.Hello, I have a challenge with how to create a kind of interaction terms for purposes of running a …
Importing several excel files: matching rowsHi everyone, I imported over 250 excel files and appended them all together to 1 dta file, by using…
Survey concordance correlationHello everyone: Is there any way to obtain accurate estimates and 95% confidence intervals for the …
What's the correct way of interpreting the (exponentiated) log odds?Hello everyone, I am trying to translate the following output to a table in a word document. Howev…
Omitted independent variables in xtabond2 using twostep system GMMHi, I am trying my data set in two-step System GMM, three variables annual GDP growth rate, Bond mar…
Subscribe to:
Post Comments (Atom)
0 Response to How to label discrete variables on histogram
Post a Comment