Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: loop


From   "Satyarth Kulshrestha" <satyarth@email.arizona.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: loop
Date   Mon, 14 Oct 2002 23:13:05 -0700

hi,

this is in continuation of my problem of generating number series.

can i run a a loop like the following in STATA:

for city = 1 to 2
for house = 1 to 40
for sample = 1 to 5
gen code = string(city)+string(house)+string(sample)
next sample
next house
next city

i know this is not STATA syntax but i am trying to express the problem intuitively.

thanks,
Satyarth

Satyarth Kulshrestha
MS-Epi IDP, Graduate Research Assistant,
College of Public Health
University of Arizona

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index