Home  >>  Archives  >>  Volume 16 Number 3  >>  dm0090

The Stata Journal
Volume 16 Number 3: pp. 632-649



Subscribe to the Stata Journal
cover

A sparser, speedier reshape

Kenneth L. Simons
Department of Economics
Rensselaer Polytechnic Institute
simonk@rpi.edu
Abstract.  A new command, sreshape, supports sparse and speedy reshaping of data. Often reshaped data are "sparse" in the sense of containing many missing values that are dropped after reshaping. sreshape automates the process of reshaping and dropping such missing information to avoid potential errors and, for both sparse and nonsparse data, yields speed improvements. Using large test datasets, sreshape achieves identical results to reshape 8 to 31 times faster in wide-to-long reshapes and 2 to 13 times faster in long-to-wide reshapes. Further suggested improvements may allow StataCorp to increase these speed gains in the built-in version.
Terms of use     View this article (PDF)

View all articles by this author: Kenneth L. Simons

View all articles with these keywords: sreshape, reshape, sparse data, missing data, long form, wide form, data management, speed

Download citation: BibTeX  RIS

Download citation and abstract: BibTeX  RIS