Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Looping through a range of variables


From   Rachel <[email protected]>
To   statalist <[email protected]>
Subject   st: Looping through a range of variables
Date   Fri, 17 Nov 2006 10:15:42 -0500

I'd like to loop through a large number of variables that don't have
common prefixes or suffixes.   So I'd like to create a loop that goes
through all variables in a range (e.g. Var1-New7 where the variables
are Var1 Var2 New3 New7.).

"Foreach" requires a list, not a range, so that doesn't work.  And
ForValues obviously only accepts numbers.

Is there a way of doing this?

Thanks,
Rachel
*
*   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