| ![]() |
From | Jeph Herrin <junk@spandrel.net> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Looping through a range of variables |
Date | Fri, 17 Nov 2006 11:29:51 -0500 |
Just be sure that this is the order of the variables in the dataset. Richard Goldstein wrote:
why not: foreach var of varlist Var1-New7 { Rich Rachel wrote: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/
* * 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–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |