[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: looping over observations
I have 100 observations.
I want to execute some commands for each observation.here is the basic
structure:
local i=0
while `i'<=100 {
local ++i
if ((husbage1>husbage2) | (husbage11 <husbage2)) {
stata commands
}
else {
stata commands
}
}
if the logical statment is true for the first observation, it executes all
commands within the if statement for other observations as well, although
the logical statement is false for some observations.
what is my mistake here? How can I write a loop that executes some bunch of
commands (including if else statement)?
thank you.
_________________________________________________________________
En etkili ve g�venilir PC Korumayi tercih edin, rahat edin!
http://www.msn.com.tr/security/
*
* 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/