Hi,

I am trying to output the ttable2 results of different groups. The code I am writing is as follows:

Code:
 foreach group of grouplist new1 sand sean female highschool{
logout, save (E:\Data\stata\des_new\`group') excel replace: ttable2 weight long education numest perc, by(`group')
}
But the stata keeps saying "invalid syntax".

I have no problem to run:

Code:
logout, save (E:\Data\stata\des_new\new1) excel replace: ttable2 weight long education  numest perc, by(new1)
I will appreciate it very much if someone can tell me what is wrong here. Thanks!