Announcement

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

  • keeping values with either one of conditions

    Hi, I'm very new to Stata and hoping I can find an answer to my question here. Excuse me if this has previously been discussed somewhere, but I did not find anything that actually helps.
    I am working with a global dataset and would like to keep specific countries (Latin American & Caribbean) in my sample but delete all the others. I do know how to work the "keep" command and have already used it in order to get rid of all countries outside my interest. However, there are two different country identifications in the data (one for the headquarter and one for the country of incorporation). I would basically like to keep all firms in my dataset that are headquartered OR incorporated (or both obviously) in Latin America, instead of using only one of them. Is there any way I can use the keep function to do that?


  • #2
    yes, of course - use the "or" operator (|); see
    Code:
    help operator
    note that to show you exact code, you need to supply more information; the FAQ has advice on asking questions, including the use of -dataex- and CODE blocks to show example data

    Comment


    • #3
      Thanks a lot! That was exactly what I was looking for.

      Best Ismael

      Comment

      Working...
      X