This should work in Stata 9:
sysuse auto,clear
graph bar mpg turn trunk, over(rep) stack blabel(bar) name(gr1,replace)
graph bar mpg turn trunk, over(rep) percent stack blabel(bar)
local j = 1
forv i = 1/5 {
foreach var of varlist mpg turn trunk {
qui sum `var' if rep == `i'
local a = round(r(mean),.001)
gr_edit .plotregion1.barlabels[`j'].text = {}
gr_edit .plotregion1.barlabels[`j'].text.Arrpush `a'
local ++j
}
}
Scott
On Wed, Aug 13, 2008 at 10:42 AM, Shehzad Ali <[email protected]> wrote:
> Thanks, Scott. Can this be done in Stata version 9?
>
> Shehzad
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/