Merge adjacent records of time-span data
spellmerge, spell(start end) [by(varlist) gap(days)]
spellmerge merges observations of timespan data that are adjacent.
id date0 date1 1. 1 1jan2000 2jan2000 2. 1 2jan2000 8jan2000 3. 1 12jan2000 20jan2000
id date0 date1 1. 1 1jan2000 8jan2000 3. 1 12jan2000 20jan2000
by(varlist) specify subset within which merging must take place. Usually an identifyer, but typically should include time-varying characteristics as well.
gap(days) specify maximum gap (in days) between spell for it to be considered adjacent. Default is zero.
E. Leuven, Department of Economics, University of Amsterdam. If you observe any