Could you, please, let me know how to obtain the scalar for the value of
the column sum? I need the value I get using "egen sum(x)", but not the
column of these values, but just a single number which stata would terat
as a scalar. Thank you.
egen sum is not the right construct (unless you want a column containing
the scalar, and you don't). It is also useful to remember the difference
between egen sum and gen sum; the latter will produce the running sum, and
the scalar you want is in the last obs. But either is inefficient because
they involve defining a new variable that you do not want. Rather,