[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: loop over local list
What is wrong with this piece of code (which gives an 'invalid syntax'
local married "0 5"
local single "5 6"
foreach mstat in `mar' `sng'
keep if marstat > `1' & marstat <= `2'
the last line is the one that produces the error.
What I'm trying to do is make a loop, in which the first run keeps values of
marstat 1 through 5, and the second run keeps value 6. Is there an
alternative solution? Note that marstat has values 0 to 6 where 0 stands for
'not available', 1-5 are for people who were at some point married and 6 for
people who were never married. I could recode it, but I'll lose information
that I might need in the future.
thanks in advance,
* For searches and help try: