Dear stata members,


Is there any way to run loops over OBSERVATIONS, not variables, together with the "by" command

e.g. something like
Code:
by student_id :  while i<num_of_observations { run code }

Thank you in advance