Announcement

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

  • Dropping observations based on a list of ID

    Hello,

    Is there a way to drop observations using a list of IDs ? I have a dataset and there are several observations (about 20k) I need to drop. I have the ID of these observations but they are too long to paste in the command.

    To give the context of this issue, I have two datasets, one of firms with different segments and one of all firms, I want to remove all multi-segment firms and get a dataset of only firms operating in only one industry segment.

    Any advice is greatly appreciated! Thank you

  • #2
    Code:
    use data_set_with_all_firms, clear
    merge 1:1 ID using data_set_of_firms_to_drop, keep(master) nogenerate

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      Code:
      use data_set_with_all_firms, clear
      merge 1:1 ID using data_set_of_firms_to_drop, keep(master) nogenerate
      This is exactly what I need. Thank you so much for the prompt response!

      Comment

      Working...
      X