I have created a toy example for my question
Code:
set obs 5 gen x1 = 1 gen x2 = 1 gen y1 = 1 gen y2 = 1 forvalues t = 1(1)2 { foreach var of varlist x y { sum `var'`t' } }
P.S, I need the t loop because in the real problem, I have to read the dataset that are named based by years.
Thanks!!
0 Response to Loop inside another loop
Post a Comment