Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: How to drop low frequency patterns from panel data


From   Kim Peeters <kimpeeters84@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: How to drop low frequency patterns from panel data
Date   Fri, 3 Feb 2012 01:22:57 -0800 (PST)

Dear Statalist users,

I have an unbalanced panel data set. The yearly data spans a period of almost twenty years. However, most subjects only participated in the last years of the study, which is confirmed by the analysis of the different panel patterns using -xtdescribe-. While some patterns' frequency is >1000, other patterns only occur once. To improve the data quality, I would like to drop all patterns that occur less than twenty times.

I have not been able to accomplish this. Thus far, I can only re-generate the -xtdescribe- output again.
xtpatternvar,gen(pattern)
egen tag =tag(ID)
tabulate pattern if tag, sort

Any advice on how to drop low frequency patterns from panel data?

Thank you!

Best regards,
Kim

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index