Announcement

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

  • Keep only duplicates

    Hi everyone,

    I am new to STATA and currently writing my thesis in social science. I'm working with panel data. There were two measurement points. They are currently stored underneath eachother in the data viewer.
    Every Person has their own ID (ID_t). I'm only interested in the people that answered the questionary at both measurement points.

    What I want to do now is identify all duplicated ID_t and drop all ID_t that only answered at one measurement point.

    I hope that makes sense somehow - Apologies for my poor explanation - you might have figured I am not experienced with working with data.

    Greetings and thanks in advance,
    Laura

  • #2
    The problem makes sense abstractly but not concretely in terms of what code to suggest.

    Data example please. https://www.statalist.org/forums/help#stata explains about dataex.

    Comment


    • #3
      I'm not sure if I understood right. If so, perhaps - duplicates tag - will, err, tag the duplicate observations. Those you wish to exclude (use the if condition for that matter) will have zero value in the newly created variable.

      Hopefully that helps.
      Best regards,

      Marcos

      Comment


      • #4
        Thank you Nick and Marcos! The problem has been solved!

        Greetings,
        Laura

        Comment

        Working...
        X