Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Changing IDs across rounds

    Dear all,

    I am currently working with the World Bank Living Standard Measurement survey. It is a rotating panel, where households usually stay for three rounds and then get replaced. In particular, I am using 8 rounds of data from Uganda, where the same households were surveyd for the first three consecutive rounds (baseline). During the fourth round, 1/3 of the households were replaced by new households, who then stayed for rounds 4,5 and 6. During the fifth round, another 1/3 of the baseline households were replaced and the new ones stayed on for rounds 5,6 and 7. During the sixth round, the last remaining 1/3 of the baseline households were replaced by new ones who stayed on for rounds 6, 7, 8.

    The problem is now that from round 4 onwards household id's are changing. For instance round 4 has a new household id and an old one from round 3 to identify those households in round 4 who were already surveyed in round 3. In round 5 a new household id was created, while keeping the household id from round 4 to identify those households in round 5, who were already surveyed in round 4 ( and potentially already in round 3,2 and 1).

    I am now trying to create one unique household id across rounds. I am attaching an easy example from excel, where I would like to be able to code the column "Unique ID", but I do not know how.

    Any help would be appreciated.

    Thanks a lot!



    Click image for larger version

Name:	Bildschirmfoto 2022-05-06 um 15.21.43.png
Views:	1
Size:	21.2 KB
ID:	1663317





  • #2
    While your screenshot a spreadsheet makes clear the kind of problem you face, I doubt anybody can help you without examples of actual data. If you provide actual example data from each round of the survey, using the -dataex- command to do, it can be worked out. Be sure your examples from the rounds includes some households that actually track across rounds. You don't actually need to show any of the economic data in your examples, just one example data set for each round containing whatever household id variables that round contains. Also bear in mind that if you are not using the current version of Stata (version 17) you must state which version you are using so nobody wastes their time or yours writing code that you can't run. This is particularly salient for this problem as the approach in recent Stata would be substantially different from older Stata.

    If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    Comment

    Working...
    X