Statalist The Stata Listserver


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

st: RE: Macro display format


From   "Steichen, Thomas J." <[email protected]>
To   <[email protected]>
Subject   st: RE: Macro display format
Date   Thu, 23 Mar 2006 10:44:22 -0500

Thomas Speidel writes:
 
> Thank you Nick & Nick,
> Nick W., I tried using your syntax, but I'm having some problems:
> 
> . sysuse auto, clear
> (1978 Automobile Data)
> 
> . qui summ length
> 
> . local mymean = `r(mean)'
> 
> . twoway scatter length mpg, text(200 35 "Mean is `: %2.1f `mymean''")
> % not allowed
> 
> . di `mymean'
> 187.93243
> 
> I also tried using the rclass r(mean), instead of assigning it to a
> local macro, but to no avail.  Does the colon need to stay inside the
> compound quote?

You are missing part of the extended macro command... Try:

sysuse auto, clear
qui summ length
local mymean = `r(mean)'
twoway scatter length mpg, text(200 35 "Mean is `:di %5.1f `mymean''")
di `mymean'

-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any
attachment(s), contains information that may be confidential,
protected by the attorney-client or other legal privileges, and/or
proprietary non-public information. If you are not an intended
recipient of this message or an authorized assistant to an intended
recipient, please notify the sender by replying to this message and
then delete it from your system. Use, dissemination, distribution,
or reproduction of this message and/or any of its attachments (if
any) by unintended recipients is not authorized and may be
unlawful.


*
*   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