Announcement

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

  • Drop specific observations in a specific quantile.

    I have a dataset containing two variables: TE and EE. I use this command to generate 5 quantiles of TE:
    Code:
    xtile Q= TE, nq(5)
    then I want to delete all values of EE less than 50 in the 3rd quantile of TE. I use command bellow, but I get this error: ‘=exp not allowed’. What command should I use?

    Code:
    drop if Q=3 & EE<50

  • #2
    Try

    Code:
     
     drop if Q==3 & EE<50

    Comment


    • #3
      In Stata the symbol "=" is an assignment operator, it assigns what is on the right to the stated thing on the left. On the other hand the symbol "==" is a logical operator checking whether the left and right hand side are equal.

      Comment


      • #4
        Thank you. Sorry for such a dumb question.

        Comment


        • #5
          Originally posted by Amir Moayeri View Post
          Thank you. Sorry for such a dumb question.
          There are no dumb questions... only dumb answers :P.

          Comment

          Working...
          X