Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: patterns of panel data (indicators of)


From   gcruces@worldbank.org
To   "Statalist@Hsphsun2.Harvard.Edu" <Statalist@hsphsun2.harvard.edu>
Subject   st: patterns of panel data (indicators of)
Date   Fri, 9 Aug 2002 16:16:11 -0400

Dear All,

I am working with panel data and I found the program xtpattern extremely useful.
Basically, it creates a string variable for each observation with the patterns
you would obtain by "xtdes" (describing) the data, sp say:
1.1..1
indicates that a unit of observation (say, a household) is present on time
periods 1,3 and 6.
What I need now is to know how many contiguous observations there are, so for
instance:
1.1..1 would be zero
111111 would be six
111.11  would be (perhaps) three (the max).

The obvious thing would be to parse through the string generated by xtpattern...
but I couldn't find an elegant way around this problem. Any ideas on this?

Thank you all

best,

***************************
Guillermo Cruces

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index