Announcement

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

  • Keeping mutliple observations

    Hello,

    I am currently working with a complete dataset with all firms in a country. However, I only want to use some of the firms for my analysis. How is it possible to keep multiple observations at the same time in order to constrict the values in my dataset.

    I tried keep if =="XX" for every observation that I needed to keep, but then it just kept the first observation. I also tried drop if!="XX" for every observation, but that also did not work.

    Would appreciate your help! Thank you!

  • #2
    You didn't get a quick answer. You'll increase your chances of a helpful answer by following the FAQ on asking questions - provide Stata code in code delimiters, readable Stata output, and sample data using dataex. A small sample data set would help us understand what is going wrong.

    You need a variable after if to say what variable you're applying this to.

    keep if x1=="XX"

    Comment

    Working...
    X