Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: Problmes with the ID in Panel dataset


From   "Rienzo, C" <C.Rienzo@rhul.ac.uk>
To   "Rienzo, C" <C.Rienzo@rhul.ac.uk>, <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: Problmes with the ID in Panel dataset
Date   Thu, 2 Dec 2010 11:27:44 -0000

Sorry Nick, forget about this you suggested something different than the group.

Thanks

cinzia

-----Original Message-----
From: Rienzo, C 
Sent: 02 December 2010 11:25
To: 'statalist@hsphsun2.harvard.edu'
Subject: RE: RE: Problmes with the ID in Panel dataset

Thanks Nick, 
I have thought about the group, but one issue (that I did not mention) is that the panel is unbalanced so if I create a group with the example I gave before that would be:

ID    year   sex   yearbirth    group    
12   1986    1           1965     1         
13   1986    2           1960     2

But if the first group in year 1987 identifies a different worker:
ID   year    sex   yearbirth   group
10   1987    1       1955         1
12   1987    2       1958         2
13   1987    2       1960         3   

Then when merging by group I won't  get the correct merging? Am I wrong?
Thanks,

Cinzia 
     

From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: 02 December 2010 11:15
To: 'statalist@hsphsun2.harvard.edu'
Subject: st: RE: Problmes with the ID in Panel dataset

Setting aside the serious possibility of sex reassignment surgery, it would seem that the simplest option is to form new identifiers from 

. egen newID = concat(ID sex) 

which has to be applied before merging. -egen, group()- for once strikes me as a bad idea. 

Nick 
n.j.cox@durham.ac.uk 

Cinzia Rienzo

I am struggling to solve a problem with the id in the panel dataset I 
am using and I would appreciate any advices:

First of all the panel data has a problem of duplicated id for the 
worker identifiers; I can solve this (and  I did) just using the 
duplicates commands.
However after merging the data for different years I realised that the 
same id  in different  years sometimes  identifies  different workers, 
here is an example:

ID    year   sex   yearbirth     wage 
12   1986    1           1965              2
12   1987    2           1958              3.2
12   1988    1           1965              2.3
12   1989    2           1958              4.1
13   1986    2           1960               2
13   1987    2           1960               2.2
13   1988    1           1954               3.4

Now I have been searching through the FAQ but I could not find a 
solution appropriate to my query; 
I have tried the tag id sex, but it did not help and also I have tried 
something similar to: 
http://www.stata.com/statalist/archive/2008-06/msg00978.html

The second problem is that when using the merge or joinby commands 
(with STATA 10) to merge different years combining by  “id sex 
yearbirth”  the dataset is not merged properly since the above problem 
persists. 
Maybe I should drop the duplicates after the merging, if I would be 
able to make that work properly!


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index