I am not knocking -egen-. I may be its greatest
fan in the Stata community. I have found it helpful
in my own work to be able to use, and to write -egen-
functions. But it is not, itself, an enormous deal. It is at root
a rag-bag of convenient short-cuts. For example,
if -egen, total()- did not exist, we could get
there typically in two lines instead of one,
as in
bysort bar: egen foototal = total(foo)
being done by
bysort bar : gen foototal = sum(foo)
by bar: replace foototal = foototal[_N]
I think that may understate egen's value a bit. True, as far as
typing goes, it may sometimes only save you a line or two. But for
many people it will also save the several hours it would take to
figure out what those two or three lines would be!