Announcement

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

  • Creation Dummy Variable with multiple "name" conditions

    Hello Everyone,
    I am new to Stata and Statalist and need help with the following situation:
    I have a dataset consisting of 1000+ US banks. I want to create a dummy that tells me whenever they are either located in a group of 144 pre-specified US counties, or located in another group of 198 counties. The lists are not overlapping, so each county is only included once in either of the two groups.
    Could anyone help me wrt to creating the Dummy? How do I implement the 300+ county names into the variable?
    I would be very grateful for your help!
    Best,
    Chris

  • #2
    Place the names of counties constituting one group into a separate dataset and merge this with the full dataset. You can thus differentiate the groups using the variable _merge

    Comment


    • #3
      Andrew gives excellent advice. Please note that this is already an FAQ: https://www.stata.com/support/faqs/d...s-for-subsets/

      Comment


      • #4
        Dear Andrew, dear Nick,
        Thank you for your quick feedback!

        Comment

        Working...
        X