Since looping is slow, I'm trying to make some calculations with "by". trouble is that I need to know/access which group the command is currently working on. I could not find any such information in the help files however... an example of what I would have liked have is:
where `rep78' would be the current group that bysort works through. in this case it would be 1 2 3 4 5.
Any way to achieve this or any work-around that would work similarly which does not necessitate a loop of the sort:
Code:
clear all sysuse auto bysort rep78: summ price if headroom <= `rep78'
Any way to achieve this or any work-around that would work similarly which does not necessitate a loop of the sort:
Code:
clear all sysuse auto levelsof(rep78), clean local(levels) foreach level of local levels { summ price if headroom <= `level' & rep78==`level' }
Comment