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

Re: st: repeated time unbalanced panel data


From   Daniel Lawson <[email protected]>
To   [email protected]
Subject   Re: st: repeated time unbalanced panel data
Date   Fri, 8 Oct 2004 15:24:57 -0500

On Oct 8, 2004, at 2:49 PM, Paulo Loureiro wrote:

The first individual of the first line of the year 1981 is the same individual in the first line of 1982. He would be the same individual of the first line of the year 2001.
How is this consistent with an unbalanced panel as the subject line states? Are there blank lines for the missing observations?


On Oct 8, 2004, at 3:16 PM, Daniel Lawson wrote:


I don't know if I understood the data structure correctly, but if I do, this should produce a tsset that you can then use with xtreg or other panel data tools. There's probably a better way to do this than what I'm suggesting.

gen individual_ID = 1
replace individual_ID = individual_ID[_n-1] + 1 if (_n>1) & (year[_n] == year[_n-1])
quietly sum individual_ID
replace individual_ID=individual_ID + (id - 1)*r(max)
tsset individual_ID year

Peace,
Daniel Lawson

On Oct 8, 2004, at 2:49 PM, Paulo Loureiro wrote:


Dear list members


This pseudo- panel database was constructed from successive cross-sections data. Cohorts of individuals over time are defined by date of birth
*
*   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/

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