Hi,

I have a binary variable (childcare_nofsa) and a categorical variable (state). I'd like to produce a stacked bar graph showing the frequencies of "provided" and "not provided" response categories in childcare_nofsa per state.

Here are data examples for the two variables:

childcare_nofsa

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float childcare_nofsa
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
0
0
.
0
0
0
0
0
0
0
0
.
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
end
label values childcare_nofsa childcare_nofsa
label def childcare_nofsa 0 "Not provided", modify
label def childcare_nofsa 1 "Provided", modify

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float state
1
1
1
1
1
2
2
2
2
2
2
2
3
3
3
3
3
3
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
end
label values state state
label def state 1 "AK", modify
label def state 2 "AL", modify
label def state 3 "AR", modify
label def state 4 "AZ", modify
label def state 5 "CA", modify
So far, I've used the following code

Code:
graph bar (count) childcare_nofsa, over(state) stack
That gets me the digital picture I've inserted here.

Array

What I'd like to achieve however is
(1) Stacking the responses in terms of the relative frequencies of the values of 1 and 0 in "childcare_nofsa"
(2) Getting the states names to appear vertically so they are all individually legible.
--> I've added an analog picture of what's in my mind's eye.

Array

Grateful for any help