Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Macro display format


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Macro display format
Date   Wed, 22 Mar 2006 22:50:49 -0000

No. You should try 

` : di %9.1f `r(mean)'' 

See help extended_fcn. 

Tip: I would go `: di %2.1f `r(mean)'' even 
if you are sure that format is too restrictive. 
You're likely to be wrong, as Stata will stretch the space to 
avoid damage. However, with %9.1f you are likely to get the ugly 
spaces that are a consequence of what you asked
for. 

Nick 
[email protected] 

Thomas Speidel
 
> I am trying to include the content of a macro within a graph, but I'm
> having problems with the display format.  
> 
> For example:
> 
> sysuse auto, clear
> qui: summ length
> twoway scatter length mpg, text(200 35 "The mean of length is:
> `r(mean)'")
> 
> How do I change the format of the macro to display something 
> like %9.2f?
> 
> I tried:
> ... , text(200 35 "The mean of length is: `%9.1f `r(mean)''")
> 
> Am I missing some triple compound quote? :-)

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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