ONESPELL: Stata module to generate single longest spell for each unit in panel data, listwise
Abstractonespell produces a subset of a panel data set in which all observations on varlist are non-missing and contiguous in the time dimension. If a panel unit contains more than one such subset, the longest "spell" is retained. Although performing this operation for a single variable of interest is fairly straightforward, this routine deals with a more challenging task: generating the single longest spell in a listwise fashion, across a set of variables. This applies the same logic as does, e.g., regress: an observation with a missing value in any variable will be deleted from the regression sample. Some matrix software (e.g., DPD for Ox) requires that panel data be organized in this fashion, with each unit appearing as a single contiguous block of non-missing observations. onespell will produce such a dataset, which after conversion to Stata version 6 format (by, e.g., Stat/Transfer) may be read directly by Ox. The routine has been tested with the latest version of Ox (3.40) and the DPD package (1.21). The routine makes use of N.J. Cox's -tsspell-.
Download InfoIf you experience problems downloading a file, check if you have the proper application to view it first. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.
Bibliographic InfoSoftware component provided by Boston College Department of Economics in its series Statistical Software Components with number S448601.
Programming language: Stata
Requires: Stata version 8.2
Date of creation: 15 Jan 2005
Date of revision:
Note: This module should be installed from within Stata by typing "ssc install onespell". Windows users should not attempt to download these files with a web browser.
Contact details of provider:
Postal: Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA
Web page: http://fmwww.bc.edu/EC/
More information through EDIRC
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F Baum).
If references are entirely missing, you can add them using this form.