[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: graph bar labels with number of observations
Dear Statalist users,
I have the following graph bar code for three categorical variables, var1, var2
graph bar var1, over(var2) over(var3) title("Mean of var1 by var2 and var3")
What I'd like to add is the number of observations that are included in the
each bar. I can manually do this with this code:
sort var2 var3;
by var2 var3: summ var1;
The output will give me summary statistics for 9 groups of var1: all the
combinations of the three categorical variables: when 0, 1 and missing.
But, how can I incorporate this information in the bar chart above?
I tried to extract the information manually and go through the blabel option, but I was unsuccessful. Blabel option can only do a few things: use bar height or names of yvars.
In a histogram, this is easily accomplished: I would use these two options: frequency and addlabel. But, how to do it with a graph bar..?
I greatly appreciate your help.
University of Washington Seattle
* For searches and help try: