I'm endeavoring to loop over two locals. The first local is made up variables consisting of survey data indicating participation in a given program, the second local consists of variables indicating if the program was helpful. I would like a loop that first presents the tabulate command on participation, then applies the tabulate command to how helpful respondents found the program for those who participated.
Essentially, I'd like to get the following:
Code:
tab program1 tab helpful1 if program1==1 tab program2 tab helpful2 if program2==1
I've tried the following:
Code:
forvalues a = 1/7 { local programs program1 program2 program3 program4 program5 program6 program7 local helpful helpful1 helpful2 helpful3 helpful4 helpful5 helpful6 helpful7 foreach p of local programs{ foreach h of local helpful{ tab `p' tab `h' if `p'==1 } } }
Thanks for any assistance you can provide!
0 Response to Looping over two locals
Post a Comment