Announcement

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

  • How to deal with a variable with multiple responses (choices)

    Dear all,
    I want to remove one response from a variable which contains several responses.
    How I can do that ?
    please see this
    this is how my data looks like

    HTML Code:
    ----------------------- copy starting from the next line -----------------------
    [CODE]
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str35 personnelid
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    ""                          
    "10131940,30639691"         
    "107259,107259,107259"      
    "107259,107259,107259"      
    "30104258,30262459"         
    "30104258,30262459"         
    "30104258,30262459"         
    "30104258,30262459"         
    "30104258,30262459"         
    "30104258,30291683"         
    "30104258,30291683"         
    "30104258,30291683"         
    "30104258,30291683"         
    "30104258,30291908"         
    "30104258,30291908"         
    "30104258,30291908"         
    "30104258,30291908"         
    "30104258,30302402"         
    "30104258,30335049"         
    "30104258,30343554"         
    "30104258,30357235"         
    "30104258,30371583"         
    "30104258,30429955"         
    "30104258,30429955"         
    "30104258,30430230"         
    "30104258,30547034"         
    "30104258,30583969"         
    "30104258,N/A"              
    "30105096,30259940,30430171"
    "30105096,30299795,30429328"
    "30105096,30334768"         
    "30105096,30334768,30429833"
    "30105096,30361782"         
    "30105096,30368369"         
    "30105096,30428814,30368369"
    "30105096,30428823"         
    "30105096,30430186"         
    "30105096,30430186,30429833"
    "30108230,30342068"         
    "30108230,30342068"         
    "30108230,30357355"         
    "30108230,30394712"         
    "30108230,N/A"              
    "30108230,N/A"              
    "30108848,30361514"         
    "30108848,30361514"         
    "30108848,30361514"         
    "30108848,30361514"         
    "30108848,30429596"         
    "30108848,30429596"         
    "30108848,30429596"         
    "30108848,30429596"         
    "30108848,30429596"         
    "30108848,30429596"         
    "30108848,30429971"         
    "30108848,30429971"         
    "30108848,30545287"         
    "30108848,30583598"         
    "30112670,30258685"         
    "30119060,30429039"         
    "30125158,30287066"         
    "30125158,30287066"         
    "30125158,30287066"         
    "30125158,30295085"         
    "30125158,30295085"         
    "30125158,30336749"         
    "30125158,30372934"         
    "30125158,30429338"         
    "30125158,30429543"         
    "30125158,30429600"         
    "30125158,30429600"         
    "30125158,30546914"         
    "30125314,30262604"         
    "30125314,30262604"         
    "30125314,30262936"         
    "30125314,30262936"         
    "30125314,30262936"         
    "30125314,30262936"         
    "30125314,30307505"         
    "30125314,30363919"         
    "30125314,30363919"         
    "30125314,30363919"         
    end
    [/CODE]
    ------------------ copy up to and including the previous line ------------------

  • #2
    Alkebsee:
    you may want to try:
    Code:
    drop if response==<thevalueyouwanttodrop>
    A word of advice: save a copy of your original dataset before going -drop-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Alkebsee:
      you may want to try:
      Code:
      drop if response==<thevalueyouwanttodrop>
      A word of advice: save a copy of your original dataset before going -drop-.
      thank you very much

      Comment

      Working...
      X