If one performs -egen- across the entire dataset rather than -,by()- then it
returns what is essentially the same scalar for every observation.
Is there any way to actually generate a scalar rather than a variable?
For example, I am interested in having a scalar or local macro which
contains the largest value of either of two variables
i.e.
. egen maxmort = max(p_pred_mort)
. egen predmort = max(p_act_mort)
. local maxmax = max(maxmort, predmort)
. drop maxmort predmort
I know that bytes are cheap these days, but it seems odd that I have to
generate 100,000 of each of these values when I only need one. Or do I have
major conceptual issues?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/