Dear Statalist,
I would like to use a forvalues loop where one of the numerics are derived from a macro. In turn, that macro is itself derived from another macro inside a foreach loop.
I issue all lines of code at once. Code below renders "invalid syntax". Why? Thank you. (Stata 15 on Windows).
I would like to use a forvalues loop where one of the numerics are derived from a macro. In turn, that macro is itself derived from another macro inside a foreach loop.
I issue all lines of code at once. Code below renders "invalid syntax". Why? Thank you. (Stata 15 on Windows).
PHP Code:
clear
local cohort 1957 1958 1959
foreach x of local cohort {
local age 2012-`x'
forvalues y = 52/`age' {
display `y'
}
}
Comment