[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: Calculating means not using "collapse"
> It seems to me that if your concern is with the
> disappearance of the original variables from the data set,
> one could generate a new variable equal to the old one, and
> use collapse with the new variable. The original variable
> will then still be preserved.
Sorry, I don't understand this suggestion. Having
a clone of a variable nearby doesn't inhibit a -collapse-,
with its inevitable loss of information,
nor should it.
That is, suppose I
. gen mpg2 = mpg
. collapse mpg, by(rep78)
The -mpg2- disappears along with
everything else. All that is left
is one value for each group of -rep78-
and the group statistics (means) of
Or am I missing something?
* For searches and help try: