Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: Re: pass quotes in a local macro


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Re: Re: pass quotes in a local macro
Date   Sat, 27 Jun 2009 01:06:44 +0200

***
sysuse auto, clear
levelsof for, local(levs)
foreach level of local levs{
loc xt `xt' `level' /* */ "`:label(foreign) `level''"
}

tw sca pr for, xla(`xt', angle(90))

***

HTH
Martin
_______________
----- Original Message ----- From: "moleps islon" <[email protected]>
To: <[email protected]>
Sent: Saturday, June 27, 2009 12:57 AM
Subject: st: Re: pass quotes in a local macro


Dear Marten,

That worked out the last part of the problemand I appreciate it, what
is left is now how to pass this into the -xlabel-option...

foreach var in `w'{

local zar=(`za'+(o+1)*(`gt'))
local er "`:label(`3')`var''"

local xt `xt' `zar' `er'

local ++gt
}
local xt `xt' `xt2'
di "`xt'"


tw `q', xtitle(`3') xlabel(none) ytitle(`1') name(`1',replace)
legend(subtitle(`2')) legend(`z') xtick `xt'
restore
end

running this results in the following local xt macro

--( .5 1 3.5 2 6.5 3 9.5 4 12.5 5 15.5 6 )-- all correct.. however for
it be meaningful in -xlabel- I need it to be

(.5 "1" 3.5 "2" 6.5 "3" 9.5 "4" etc,.etc.,...)

How can I get the double quotes into a local that is expanded ???


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

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



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