Announcement

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

  • Issue with "label list" command

    Hi, I am using STATA 13. I am encoding a categorical variable from string to numeric. Then, I am using "label list" command to see the label values assig. I have two options and for OPTION 1 the command "label list" works. But not for the OPTION 2. Please help.

    OPTION 1:

    encode var1, generate (var1_n)
    label list var1_n /*this works*/

    OPTION 2:

    encode var1, generate (var1_n)
    drop var1
    rename var1_n var1

    label list var1 /*gives an error message "value label var1 not found" */

    Kindly help me to figure out why option 2's renaming is not supporting with the "label list command". I have already completed my data cleaning with the OPTION 2.
    Thanks!
    Attached Files

  • #2
    You renamed the variable but the label list has the same name as before. Consider that the same label list can be attached to many variables, so it would be a bad idea if renaming one of them had as a side-effect renaming the label and so breaking the association of variable and value labels of all the others.

    Please see advice at FAQ Advice #12 about spreadsheet attachments.

    Comment


    • #3
      It's clear to me now. Thank you very much Nick!

      Comment


      • #4
        elabel (SSC, SJ, GitHub) lets you rename value labels, if you wanted to do this.

        Comment

        Working...
        X