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

Re: st: repeated time unbalanced panel data


From   "Paulo Loureiro" <loureiro77@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: repeated time unbalanced panel data
Date   Sat, 09 Oct 2004 15:00:37 +0000

Daniel Lawson
Thanks for the great help.
Your assumptions about the data are correct.

This worked perfectly:
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

The programming below worked great and got me the output that I needed.

I transformed my repeated time unbalanced panel data for in time series: for different years, the same individual.

I would really happy with your help on this.
Thank you very much.

Paulo Loureiro
Universidade Católica de Brasília



From: Daniel Lawson <dlawson1@nd.edu>
Reply-To: statalist@hsphsun2.harvard.edu
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: repeated time unbalanced panel data
Date: Fri, 8 Oct 2004 15:16:21 -0500

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/
_________________________________________________________________
Get ready for school! Find articles, homework help and more in the Back to School Guide! http://special.msn.com/network/04backtoschool.armx

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