Announcement

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

  • keep if

    Hi,
    I want to use " keep if" to keep a subset of observations in my dataset, but I get an error: Type mismatch

    This is the instruction I'm giving: keep if P1_DEPARTAMENTO==11

    What am I doing wrong?

  • #2
    I would guess that P1_DEPARTMENTO is not actually a numeric variable. It's data type is different from what your code leads Stata to expect, hence the error. Perhaps it is a string variable?

    Comment


    • #3
      Hermanshu! Yes, you're right! I just realized that and doing this: P1_DEPARTAMENTO=="11", worked!

      thank you

      Comment

      Working...
      X