Dear all,
I am trying to do a stacked bar graph with two bars, one for females and for males, over different years but have not succeeded.
I have three types of incomes that I want to stack in one bar for each gender over different years. I have prepared the variables like the following (the variables are all shares of the total, so the shares will be 100 % in total)
B (business income) = a
C (capital income) = a + b
L (labor income) = a + b + c
I have tried the following:
twoway (bar B_female year || rbar B_female C_female year || rbar C_female L_female year) ///
(bar B_male year || rbar B_male C_male year || rbar C_male L_male year) , ///
legend( label(1 "Business inc") label(2 "Capital inc") label(3 "Earned inc")) ///
title("Income composition at diff points in time")
but it doesn't give me two stacked bars.
Does anyone know how to do?
All help is appreciated!
Thank you!
Best regards,
Kristin
I am trying to do a stacked bar graph with two bars, one for females and for males, over different years but have not succeeded.
I have three types of incomes that I want to stack in one bar for each gender over different years. I have prepared the variables like the following (the variables are all shares of the total, so the shares will be 100 % in total)
B (business income) = a
C (capital income) = a + b
L (labor income) = a + b + c
I have tried the following:
twoway (bar B_female year || rbar B_female C_female year || rbar C_female L_female year) ///
(bar B_male year || rbar B_male C_male year || rbar C_male L_male year) , ///
legend( label(1 "Business inc") label(2 "Capital inc") label(3 "Earned inc")) ///
title("Income composition at diff points in time")
but it doesn't give me two stacked bars.
Does anyone know how to do?
All help is appreciated!
Thank you!
Best regards,
Kristin

Comment