Hi, I used the following code to create a stacked bar chart and it works very well (see the picture attached).
However, I would like to relabel the "0" and "1" on the vertical axis as "female" and "male" using the following code:
I saw the following error:
Could you let me know what's the problem? Thank you very much.
Code:
graph hbar (percent), over(tradition_family_group) over (sex) asyvars percentages stack /// blabel(bar, pos(center) format(%3.1f)) ytitle("Percentages") title("Family value by sex") subtitle(" ")
Code:
graph hbar (percent), over(tradition_family_group) over (sex, relabel(1 "Female" 2 "Male") ) /// asyvars percentages stack blabel(bar, pos(center) format(%3.1f)) ytitle("Percentages") title("Family value by sex") /// subtitle(" ")
Code:
) required r(100); end of do-file r(100);
Comment