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

st: Displaying value labels within a" foreach" statement


From   "Siyam, Amani" <[email protected]>
To   <[email protected]>
Subject   st: Displaying value labels within a" foreach" statement
Date   Thu, 21 Jul 2005 08:58:33 +0200

Dear Stata-listers,

I have the following foreach statement:

foreach i in 8 11 14 17 20 {

	foreach j in x y z  {

		display  "		Daily intake `j' at age `i'
months" 

		tabstat `j' if vnum==`i', by(site) stats(mean sd)
col(stats)
	}
}

There are value labels for the values 8 11 14 17 20 that "i" takes that
I wish to display. Is there a way I can do that, I tried adding extra
quotes around ``i'' in the "display" statement, but it did not work.


Many thanks for your help in advance.


Amani


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