Announcement

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

  • Drop all variables except

    Dear Statalist community,

    I have a large panel dataset that I am attempting to do a summary statistics on. I am only using several variables (and its respective observations) and would like to drop the rest. I could drop these other variables one by one, but that would be too many.

    Is there a command on Stata that I can input to say "Drop all variables except x y z" ?

    Thank you.

    Ashvinder

  • #2
    You may prefer to use - keep - for that, assuming you wish to, well, keep fewer variables than the ones you want to drop.

    Example:

    Code:
    keep x y z
    Best regards,

    Marcos

    Comment


    • #3
      Dear Marcos,

      Many thanks.

      Ashvinder

      Comment

      Working...
      X