*! version 1.9.0 10jan2017

Title

fegen -- Alternative to egen that optimizes speed

Syntax

fegen
[type]
newvar
=
function(arguments)
[if] [in]
[, options]

Included functions

max(exp)

group(varlist) note: varlist cannot have both string and numeric variables

Options for group()

missing treat missing values in varlist (either . or "") as any other value when assigning groups,
instead of being assigned to the group missing

method(str) the underlying method used; either mata
(default) or stata (often faster if the inputs are string or nonintegers)

nosort speeds up the mata method, but the new IDs will not respect the sort order of the inputs

ratio(#) the same as the hash_ratio option from ftools

verbose see some internal details

How to add a new function

First, create a file named _gfNAME.ado where NAME is the name of the function.
Then, inside the file, use the following scaffolding:

program define _gfNAME
syntax [if] [in], type(string) name(string) args(string) [by(varlist)] ...
tempvar touse
qui {
...
gen `type' `name' = ... if `touse'==1
...
}
end

Author

Sergio Correia

Board of Governors of the Federal Reserve System, USA

sergio.correia@gmail.com

More Information

To report bugs, contribute, ask for help, etc. please see the project URL in Github:

https://github.com/sergiocorreia/ftools