Statalist


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

st: looping with vars across file


From   mai7777 <[email protected]>
To   [email protected]
Subject   st: looping with vars across file
Date   Sat, 11 Oct 2008 02:44:28 -0400

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index