mcaceresb / stata-gtools

Faster implementation of Stata's collapse, reshape, xtile, egen, isid, and more using C plugins
https://gtools.readthedocs.io
MIT License
182 stars 38 forks source link

Keep labels after gcollapse #56

Closed elektrotiko closed 5 years ago

elektrotiko commented 5 years ago

What would you like gtools to add or change (and why)? I would like to see an option, in the same spirit as the new "uselabel" in greshape, for gcollapse as well. It is really annoying that Stata's own collapse removes variable labels after collapse and it would be just wonderful if gcollapse would enable us to keep variable labels after gcollapse.

mcaceresb commented 5 years ago

I think gcollapse already does what you want:

sysuse auto, clear
gcollapse price, labelformat(#sourcelabel#)

See the "label outputs" section here