[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: foreach syntax
The following works in Stata9:
local x =3D"lr1-ul6"
foreach i of local x{
su `i'
}
but
local x =3D"lr1-ul6"
foreach i of local x{
ttest `i',by(gender)
}
with error r(103) too many variables specified.
Could somebody please tell me what I am doing wrong.
I can't believe that either example could be considered correct
syntax. What does your local statement mean? I don't know how to
interpret =3D"lr1-ul6".
Kit Baum, Boston College Economics
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html
*
* 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/