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
Convergence Not Achieved: after Running p-varHello guys, I am new to STATA. Now I am having problem. After running pvar, there are results, but…
STATA: Statistic significance test within groups?Hi all, I am stuck at the following problem: I need to determine if there is a significant differenc…
Heckman Selection ProcedureHi Statalist, I have a quick question regarding exclusion restrictions when using Heckman Twostep. …
xtreg, fe vs areg, & size of FE constantI have a panel of N = 3810 & T = 6, and after reading forum posts have run areg, absorb(company)…
loop to append multiple files and add new variableHi there, I have a number of files named filename1990.dta, filename1991.dta etc until 2018. I would…
Subscribe to:
Post Comments (Atom)
0 Response to How to label discrete variables on histogram
Post a Comment