[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Missing values in -egen-
I have noticed what seems to be a rather unfortunate
feature of -egen-. In Stata version 8, I typed the
by id: egen statefcount = sum(state == .f)
expecting to get, for each id, a count of the number
of observations with state == .f. Unfortunately,
because version is set to less than 8 in egen.ado, I
got, for each id, a count of the number of
observations with missing values of any sort (. plus
.a through .z). (See Stata 8 User's Guide, p. 116.)
This will no doubt surprise many users--the user has
to know which version of Stata -egen- is written in to
know how it will behave. Furthermore, it means that
-egen- does not work in a way paralled to -generate-;
by id: generate statefcount = sum(state == .f)
counts only the .f's. Moreover, if -egen- is ever
updated to version 8, its behavior will change (or it
will have to be made to artificially conform to
strange way it works now).
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
* For searches and help try: