Hi all,

I use Stata 16.1 and I'm trying to make bar charts for two different groups.

The first group is a binary variable that accounts for language (0 for German and 1 for French) called lang.

The second group is a binary variable as well that accounts for the conjuction of language and whether the individual works in the public sector (0 for German speaker AND public worker; 1 for French speaker AND public worker). This variable is called pub_lang; missing values are for people that work in the private sector - which I'm not interested in.

To create this variable, I used this code
Code:
g pub_lang=.
replace pub_lang=1 if public==1 & lang==1
replace pub_lang=0 if public==1 & lang==0
Basically, I'm just trying to see the difference in mean for a variable that depicts general trust in people - called gtrust - between German and French speaker in general, and between German and French speaker among public workers (I'm studing a bilingual region).

Here is a subset of my database:

input byte gtrust float(lang pub_lang)
5 1 .
3 1 .
3 1 .
6 1 .
0 1 .
5 1 .
. 1 .
. 1 .
6 1 1
. 1 .
8 1 1
6 1 1
6 1 1
4 1 1
. 1 .
. 1 .
. 1 .
6 1 .
. 1 .
4 1 .
6 1 1
4 1 .
7 1 .
5 1 .
5 1 .
7 1 .
. 1 .
. 1 .
6 1 .
7 1 .
3 1 .
5 1 .
4 1 .
. 1 .
4 1 .
5 1 1
5 1 1
5 1 1
5 1 1
. 0 .
7 0 0
. 0 0
8 0 0
. 0 .
8 1 .
8 1 .
8 1 .
8 1 .

I use the following code:

Code:
graph bar (mean) gtrust, over(lang) over(pub_lang)
But for some reason, Stata only shows me the mean for the observations worthing 0 in one group and the observations worthing 1 in the other group: Array



Does anyone know what's going on? I suspect that it's because of pub_lang being a compound variable, but not sure.

Thank you.