*! version 1.2.14 02feb2013

Title

[D] egenmisc -- Misc egen functions.

Syntax

egen [type] newvar = fcn(arguments) [if] [in]
[, options]

where depending on the fcn, arguments refers to an expression,
varlist, or numlist, and the options are also fcn
dependent.

fastwpctile(varname) [, percentiles(numlist) weights(varname) altdef by(byvarlist)]

like pctile but faster.

fastxtile(varname)[, percentiles(numlist) nquantiles(#) weights(varname) altdef by(byvarlist)]

like xtile but faster.

nacorr(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sample correlation of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

nacov(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sample covariance of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

namean(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sample mean of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

nasd(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sample standard deviation of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

nasum(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sum of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

navar(varlist) [, by(byvarlist) min(num)]

creates a constant (within byvarlist) containing the sample variance of varlist.
The option min sets the new variable to "." when there are less than num observations such that both variables in varlist are non missing.

pick(expr) , when(condition) by(byvarlist)

creates a constant (within byvarlist) containing the value of expr for the row satisfying condition.

References

The function fastxtile and fastpctile borrow heavily from equivalent commands in egenmore.

Author

Matthieu Gomez

Department of Economics, Princeton University

Please report issues on Github
https://github.com/matthieugomez/stata-egenmisc