GROUPFUNCTION
High-performance data aggregation for large datasets — several orders of magnitude faster than Stata's collapse — computing means, sums, variances, first values, minima, and maxima across groups in a single pass.
Installation
ssc install groupfunctionDescription
groupfunction replaces several collapse functions (mean, sum, variance, first, max, min). The command is several orders of magnitude faster than Stata’s built-in collapse command, making it particularly useful for large datasets.
Examples
* Basic usage: mean and min by group
sysuse auto, clear
groupfunction [aw=weight], mean(price) min(weight) by(foreign)
Citation
Corral, P., Nguyen, M.C. and Azevedo, J.P. “GROUPFUNCTION: Stata module to replace several basic collapse functions.” Statistical Software Components S458475, Boston College Department of Economics.
Stay updated
Occasional updates on new writing, research, and software.
No spam. Unsubscribe anytime. Powered by Buttondown RSS
