I know that in SPSS there is way to set a filter for a series of commands using a 'do if' statement. Is there a way to do this in STATA? For example, I want to perform a large set of analyses on a set of groups (group == 1....group == 50). Do I have to continue to type if group == 1 after each command? ex:
tab race if group == 1
tab sex if group == 1
tab race sex if group == 1
tab race if group == 2
tab sex if group == 2
tab race sex if group == 2
or, is there a way to globally set off group == 1 for all analyses then a command to globally set off group == 2 for all analyses, and so on...? The above code seems too cumbersome.
*
* 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/