Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re: looping with vars across file


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: Re: looping with vars across file
Date   Sat, 11 Oct 2008 14:10:40 +0200

see -h levelsof-

HTH
Martin _______________________ ----- Original Message ----- From: "mai7777" <[email protected]>
To: <[email protected]>
Sent: Saturday, October 11, 2008 8:44 AM
Subject: st: looping with vars across file


Hi,
I have two files, file 1 and file 2. I want to use each var (one by
one) from file 1 to run a loop in file 2.
Eg:

File one:
var1  var2....varn
101    99       .
76     104     .
89     107     .

I want to run a loop in file two that takes each value for vars1-varn
in file 1 and loops over it: So for var1 of file1, I want to run the
following loop in file2:
foreach i in `i' 101 76 89 {
......
}

and so on for each var of file 1.
Is there a way to do that?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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