Announcement

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

  • Merge/append

    Hi, I am trying to merge my data set in which I have 7 waves which I want to merge, so I can track pay and other variables for individuals over time.

    I have appended my data, but want to use a m:m merge instead.

    Would this be the correct method and if so how can this be done?

    Thanks

    Attached Files

  • #2
    I have attached my do-file below.

    Comment


    • #3
      Welcome to the Stata Forum / Statalist

      Please read the FAQ. There you'll find advice about sharing data/output/command in the Forum.

      That being said, merging m:m is not recommended. Please take a look at the Stata Manual for that matter. In short, the command - joinby - may be what you wish, but this is just a guess.
      Best regards,

      Marcos

      Comment


      • #4
        I would say that the append you have done has given you exactly what you need to analyze what is apparently longitudinal survey data. Your dataset of appended data is now organized as what is called a "long layout" with one observation for each combination of pidp and wave. This is what is required by the Stata commands for analysis of longitudinal data. You should familiarize yourself with the Stata Longitudinal-Data/Panel-Data Reference Manual PDF included in your Stata installation and accessible from Stata's Help menu.

        If you insist on having one observation per pidp with multiple values of each of the variables, you will want to use the reshape wide command to transform the data you have appended from its long layout into a wide layout. But I strongly discourage you from doing so. The experienced users here generally agree that, with few exceptions, Stata makes it much more straightforward to accomplish complex analyses using a long layout of your data rather than a wide layout of the same data. You should try to achieve what you need with the data organized as it currently is, and seek the help of Statalist in doing so. The sort of problems you will encounter trying to use your reshaped data will almost certainly be solved by reshaping the data. It is much easier, for example, to compare the second observation to the first, the third to the second, and so on, than it is to compare the second variable to the first, the third to the second, etc.



        Comment


        • #5
          Thank you for your assistance!

          Comment

          Working...
          X