Announcement

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

  • Alphabetical order of value label names when listing them

    I need to double-check the output of some variable recoding based on value label content. I recoded the values according to the content of the label, and used

    labdu, delete

    in order to delete those value labels that are not used anymore.

    I want to double check that the recoding went well, so I am comparing the lists of value label before and after the (recode+labdu, delete) process.
    It would be very useful if I could order the value label names in alphabetical order for comparison.

    label list

    does not give them in alphabetical order. Is there any way of producing a list of value label names and content in alphabetical order?

    Thanks!

  • #2
    labdu is part of labutil2 (SSC).

    Listing value labels alphabetically is easily achieved using macro lists. Here is an example

    Code:
    sysuse nlsw88
    label dir
    local allnames `r(names)'
    local sortnames : list sort allnames
    label list `sortnames'
    Best
    Daniel

    Comment


    • #3
      Rossella,

      You can also use labelbook.

      Regards,
      Joe

      Comment


      • #4
        Thank you!

        Comment

        Working...
        X