Hi,
I am creating a barchart and have used the following code where var1 is a 4-category categorical variable and var2 is age in 3 categories
The graph looks how I would like. However, I can't work out how to get the bars to correspond to the within-category percentages, rather than the overall sample percentages. How do I do this on stata? Thank you
I am creating a barchart and have used the following code where var1 is a 4-category categorical variable and var2 is age in 3 categories
Code:
graph bar (percent), over(var1) over(var2) asyvars /// legend(order(1 "A" 2 "B" 3 "C" 4 "D") title("var1 category", size(small)) size(small)) /// note("Age in years", size(small) position(6)) /// ytitle("Percent") /// title("Distribution of var2 by three-category age")
Comment