Hi all,
I am trying to add custom labels to a bar graph. Currently, the labels are simply the variable labels:
graph bar (mean) EXP, over(MONTH) blabel(name, pos(outside))
What I want to do is change the labels above each bar to equal the observation count by MONTH. So, if there are 150 values of EXP being averaged in MONTH == 1, the bar label would be "150" in MONTH == 1. As months increase, my observations diminish. I would like the labels to reflect that.
I have already generated a variable (MO_N) with the monthly observation counts. For context, I have 24 months in the graph. I need to automate the process, as I will be looping over hundreds of values for a different variable.
Your help would be appreciated. Thanks!
I am trying to add custom labels to a bar graph. Currently, the labels are simply the variable labels:
graph bar (mean) EXP, over(MONTH) blabel(name, pos(outside))
What I want to do is change the labels above each bar to equal the observation count by MONTH. So, if there are 150 values of EXP being averaged in MONTH == 1, the bar label would be "150" in MONTH == 1. As months increase, my observations diminish. I would like the labels to reflect that.
I have already generated a variable (MO_N) with the monthly observation counts. For context, I have 24 months in the graph. I need to automate the process, as I will be looping over hundreds of values for a different variable.
Your help would be appreciated. Thanks!
Comment