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
Create a Variable in stata that is a value minus it's last month valueHi all, I put some data below, but I have a question about making a varialbe that is it's value min…
Generate difference variable between 2 digits sectors and relevant 3 digits sub-sectors of NACE Rev.2Dear all, I have a data set consisting of Inflation rates relating to 2-,and 3- digit sectors of Na…
Screeplot of eigenvalues from the reduced correlation matrixI assume that STATA's screeplot command prints the eigenvalues from the sample correlation matrix. H…
counting days between date and another dateDear all, I have 5 subjects who had 5 visits at different dates, I want to create a new variable tha…
Automating meta-analyses code for several outcomes using metaanHi, I have data for 40 outcomes for 2 studies. I am wondering if there is a way to automate this ra…
Subscribe to:
Post Comments (Atom)
0 Response to How to label discrete variables on histogram
Post a Comment