I've just released an augented version of Stata's collapse command, called collapse2. The only change is that there are now four new "aggregation" operators:
first -- first observation in group
last -- last
firstnm -- first non-missing
lastnm -- last non-missing
Data must be tsset to use the operators. I find these convenient for example for converting a panel data set with annual observations to one with decadal observations where I need such variables as initial
GDP and initial population.
To install, type "ssc install collapse2". Comments welcome.
David Roodman
Center for Global Development
[email protected]
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/