Announcement

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

  • Dropping Duplicate Observations

    Hi everyone,

    I am facing a question regarding the duplicates command in STATA. For example, I have 10 duplicate observations in my dataset. In order to drop duplicate observations and retain only one, I would use something like:

    duplicates drop var1 var2

    This command would keep one observation out of the 10 observations.

    However, if I wanted to drop all the 10 observations, how would I proceed (that is, I do not want to retain any observations that are duplicates)? Any ideas on this?

    Thank you.

  • #2
    Code:
    bys var1 var2: drop if _N>1

    Comment

    Working...
    X