There may be a more fancy way, but you could do something with
-levelsof- (-levels- in version 8) along the lines of...
levelsof individual, local(ind)
levelsof year, local(allyears)
gen yearsin=""
gen yearsout=""
foreach i of local ind {
levelsof year if individual==`i', local(yin)
local yout : list allyears - yin
replace yearsin="`yin'" if individual==`i'
replace yearsout="`yout'" if individual==`i'
}
Hope this helps
David
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
[email protected]
Sent: 21 February 2006 15:15
To: [email protected]
Subject: st: individuating existing (or missing) years in panel data
Dear all,
I am using an unbalanced panel data, where some individuals are missing
in certain years. My problem is that I need to know exactly what are the
years for which each individual is missing, and the database is too
large to proceed simply by inspecting the data...is there a way to
generate a new variable, telling the existing (or missing) years for
each individual?
Thank you very much for your help
Kind Regards
Mariarosaria
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
*
* 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/