Statalist


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

st: RE: pass quotes in a local macro


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: pass quotes in a local macro
Date   Mon, 29 Jun 2009 18:55:51 +0100

There were several replies to this thread and a later one, but it seems that the simplest point of all was not mentioned. 

Once you have collected all the category numeric values that occur, then you can use the -valuelabel- suboption of -twoway, ?label()- to get Stata to use the value labels. Doing it yourself by collecting the labels is a good way to learn some low-level details of Stata, but is nevertheless quite unnecessary.  

Nick 
[email protected] 

moleps islon

I´m trying to expand a local string for every category of another
variable and generate custom tickmarks and labeling on a graph. The
problem is that I do not understand how to pass quotes in a macro for
-xlabel- to understand it.

foreach var in `w'{
	
	local zar=(`za'+(o+1)*(`gt'))
	local xt `xt' `zar' ----here I´d like to pass -quote-`var' quote..
however I cannot figure out how to do this without getting error
messages.
	
	local ++gt
	}


tw `q', xtitle(`3') xlabel(`xt´) ytitle(`1') name(`1',replace)
legend(subtitle(`2')) legend(`z')


also -how can I pass the valuelabels for the different cateogires of var- ??

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