I have a quick question about the Stata syntax. I want to refer to a list of variables that are numbered consecutively (e.g., class0, class1, class2, ..., class99). Since the number of variables can change, I want to refer flexibly to the minimum and maximum values in the list. I thought of something like the following (only the first line is relevant) and hoped that someone could point me to the correct syntax, which I could not find:
Code:
foreach var of varlist class`min'-class`max' { replace `var' = 0 if `var' == . }
Best,
Marvin
0 Response to Quick syntax question: foreach var of varlist min to max
Post a Comment