help egen dialog: egen
---------------------------------------------------------------------------------------------------------------
Title
[D] egen -- Extensions to generate
Syntax
egen [type] newvar = fcn(arguments) [if] [in] [, options]
by is allowed with some of the egen functions as noted below.
where depending on the fcn, arguments refers to an expression, varlist, or numlist, and the options are
also fcn dependent, and where fcn is
anycount(varlist), values(integer numlist)
may not be combined with by. It returns the number of variables in varlist for which values are
equal to any integer value in a supplied numlist. Values for any observations excluded by either
[if] or [in] are set to 0 (not missing). Also see anyvalue(varname) and anymatch(varlist).
anymatch(varlist), values(integer numlist)
may not be combined with by. It is 1 if any variable in varlist is equal to any integer value in
a supplied numlist and 0 otherwise. Values for any observations excluded by either [if] or [in]
are set to 0 (not missing). Also see anyvalue(varname) and anycount(varlist).
anyvalue(varname), values(integer numlist)
may not be combined with by. It takes the value of varname if varname is equal to any integer
value in a supplied numlist and is missing otherwise. Also see anymatch(varlist) and
anycount(varlist).