Announcement

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

  • Drop missing

    I may be missing something but let me ask:?
    Is there a way to drop string variables with a single command? I have a data set with a large number of split variables that I don't need. I can delete them one by one but this will take a lot of time. I know that Nick Cox's dropmiss eliminates variables that are all missing, but is there a way to drop string variables with a single command? Thanks for any helpl.

  • #2
    If you want to drop all string variables, you can do with two commands if you go

    Code:
    ds, has(type string) 
    
    drop `r(varlist)'
    and you can do that with one command if you turn that code into a dedicated command of your own.

    Thanks for the mention of dropmiss, but good practice requires explaining that as coming from the Stata Journal. Indeed, it is now declared superseded as
    this extract shows:

    Code:
    . search dropmiss, sj
    
    <stuff> 
    
    SJ-15-4 dm0085  Speaking Stata: A set of utilities for managing missing values
            (help missings if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q4/15   SJ 15(4):1174--1185
            provides command, missings, as a replacement for, and extension
            of, previous commands nmissing and dropmiss
    
    SJ-15-4 dm89_2  . . . . . . . . . . . . . . . . . Software update for dropmiss
            (help dropmiss if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q4/15   SJ 15(4):1186--1187
            dropmiss command has been superseded by a new command, missings,
            which offers various utilities for managing variables that may
            have missing values
    <stuff>

    Comment


    • #3
      Thanks much.

      Comment

      Working...
      X