Announcement

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

  • Wildcard with exception

    I have a variable location, which I am splitting, e.g.
    Code:
    split location, p(", ")
    This generates location1, location2, location3 etc
    At one point I would like to drop all the newly generated variables, but not the original one. If I try
    Code:
    drop location*
    that drops the original variable too because apparently wildcard * can take any values including nothing.
    Is there a wildcard in Stata that does not include nothing?
    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

  • #2
    Code:
    drop location?*

    Comment


    • #3
      Oh, that's clever. I should have thought of it. Thanks!
      Thank you for your help!

      Stata SE/17.0, Windows 10 Enterprise

      Comment

      Working...
      X