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

st: dump variable label value into local macro??


From   [email protected]
To   [email protected]
Subject   st: dump variable label value into local macro??
Date   Tue, 15 Nov 2005 09:17:33 -0800 (PST)

Hello All,
I am using Stata/SE, v.9.1 for Macintosh.
I am -forvalue-ing across values of a categorical variable w/ nine unique
values and generating a graph for each unique value of this variable. 
This variable is numeric and i've attached a label to each value of this
variable via -label define- and -label values-.  When generating the
graphs, I would like to use the -subtitle- option to denote which level of
the categorical variable is being graphed, albeit i want the actual label
value written to the graph, not the value of the macro.  The abbreviated
syntax follows:

local i = 1
forvalues i = 1(1)9 {
gr hbar (mean) mean_abs_error mean_error_to_itd count_abs_error if
segment2==`i' , ///
subtitle("`i'") legend(off) ytitle("Absolute Error, Relative Error, &
Project Num.") ///
graph export m_error`i'.pdf, replace
	local i = `i' + 1
	}

Any suggestions?  My perusal of the online & print documentation hasn't
returned much in the way of a solution and my programming skills are
woefully underdeveloped.
Many thanks,
Clint

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