Announcement

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

  • Display variables with specific number

    Hi there,
    I want to know all variables containing a specific number. For example, I want to know all the variables that contain -222 in the dataset. How should I do this in stata?

  • #2
    findname (Stata Journal) can do this, but you must install it first. Install from the latest updated version; read the original article.


    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . findname, any(@==-222)
    
    . findname, any(@==42)
    turn
    
    . findname, any(@==41)
    mpg   turn
    
    . search findname, sj
    
    Search of official help files, FAQs, Examples, SJs, and STBs
    
    SJ-15-2 dm0048_3  . . . . . . . . . . . . . . . . Software update for findname
            (help findname if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q2/15   SJ 15(2):605--606
            updated to be able to find strL variables
    
    SJ-12-1 dm0048_2  . . . . . . . . . . . . . . . . Software update for findname
            (help findname if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q1/12   SJ 12(1):167
            correction for handling embedded double quote characters
    
    SJ-10-4 dm0048_1  . . . . . . . . . . . . . . . . Software update for findname
            (help findname if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q4/10   SJ 10(4):691
            update for not option
    
    SJ-10-2 dm0048  . . . . . . . . . . . . . .  Speaking Stata: Finding variables
            (help findname if installed)  . . . . . . . . . . . . . . .  N. J. Cox
            Q2/10   SJ 10(2):281--296
            produces a list of variable names showing which variables
            have specific properties, such as being of string type, or
            having value labels attached, or having a date format

    Comment

    Working...
    X