+ Reply to Thread
Results 1 to 3 of 3

Thread: Storing label list's output

  1. #1
    Points: 469, Level: 9
    Level completed: 38%, Points required for next Level: 31

    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Storing label list's output



    Quick question,
    Is it possible to export the output of a -label list- command for a specific variable to a separate .dta or Excel file?
    For example, in

    sysuse auto
    label list origin

    origin:
    [ 0 Domestic ]
    [ 1 Foreign ]


    How would one store both the variable name and the output inside the [].
    Thank you much!

  2. #2
    Points: 1,838, Level: 25
    Level completed: 38%, Points required for next Level: 62

    Location
    UK
    Posts
    163
    Thanks
    0
    Thanked 9 Times in 9 Posts

    Re: Storing label list's output

    Is -svvarlbl- what you are looking for?

    http://ideas.repec.org/c/boc/bocode/s400103.html

    (I haven't actually ever used this myself, but thought I would suggest it in case it helps)

  3. #3
    RoboStataRaptor
    Points: 7,341, Level: 56
    Level completed: 96%, Points required for next Level: 9
    bukharin's Avatar
    Location
    Sydney, Australia
    Posts
    1,018
    Thanks
    9
    Thanked 241 Times in 234 Posts

    Re: Storing label list's output


    I would try something simple like this:
    Code: 
    sysuse auto, clear
    tab foreign
    keep foreign
    duplicates drop
    decode foreign, gen(code)
    label drop _all
    list, noobs
    
      +--------------------+
      | foreign       code |
      |--------------------|
      |       0   Domestic |
      |       1    Foreign |
      +--------------------+

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats