Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: RE: percent format

From   "Frank de Libero" <[email protected]>
To   <[email protected]>
Subject   RE: st: RE: percent format
Date   Mon, 13 Jun 2005 14:50:17 -0700

You wrote:
I doubt you're missing anything. If you 
say within a -*label()- option 

.375 "37.5%" 

you are saying that even though the 
number is really .375 you want a display 
of "37.5%". This is a self-knitted percent 
format on the fly. 
I don't see it. Here is an example -do- to generate a simple bar chart.
If I can avoid using -text- I would. But I don't see how to apply a
label change. I'm probably missing something, but I tried, more time
than I care to admit.


----------Example do------------------

version 9.0
input coverage pct
1  60
2  27
3   9
4  16

#delimit ;
label def Coverage
1 "Employment-based"
2 "Govt. programs"
3 "Individual"
4 "Uninsured"
#delimit cr

label var cov "Breakdown of insurance coverage"
label val coverage Coverage
label var pct "Percent"

#delimit ;

graph hbar (asis) pct, over(cov, sort(cov) axis(noline))
ylabel(,nogrid) legend(off) yscale(off) asyvars showyvars
graphregion(margin(l+10 r+10)) scale(1.4)
graphregion(color(ebg)) plotregion(color(ebg))
text(65.5 88.1 "60%", color(black) size(small))
blabel(bar, position(outside) color(black) format(%3.0f))
title("Holes in the Net", bexpand span justification(left) color(black))
subtitle("A breakdown of insurance overage""in the U.S. for 2003:",
span size(medium) justification(left) bexpand)

#delimit cr

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index