Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: individuating existing (or missing) years in panel data


From   "David Harrison" <[email protected]>
To   <[email protected]>
Subject   st: RE: individuating existing (or missing) years in panel data
Date   Tue, 21 Feb 2006 15:40:59 -0000

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index