Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Fabian Schönenberger" <sch.f@gmx.ch> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: onespell |
Date | Tue, 04 Sep 2012 11:48:55 +0200 |
Dear Statalist I am using onespell, SSC stata modul from Christopher F. Baum, for panel data. I write: onespell fyear,saving(test) Observations removed: -18332 file test.dta saved fyear is a time variable (annual). For certain id, fyear has gaps if for instance the company stopped generating annual reports and started again after some years passed. I expected onespell to keep only the longest contiguous spells of fyear for each id, and other observations will be deleted from the file. But onespell adds new rows filling the gaps of fyear. In my case, onespell adds 18332 new observations (all observations except from fyear are missing). How can I keep the longest contiguous spells for fyear for each id and drop the other observations? Many thanks in advance, FS * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/