Announcement

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

  • add numlabels to variables error "dataset has no value labels"


    I am receiving an error "dataset has no value labels" when I try to add numerical values to each value using
    Code:
    numlabel, add
    How can I quickly assign numerical values to all my variables that I have imported. in the past I used
    Code:
     numlabel, add
    and it was okay.

    I have imported an excel file into Stata and saved as dta.

    Is there no quick way of using this?

  • #2
    If you do not get any replies, supply a sample of your data using -dataex-, and explain how you want the outcome of what you want to do look like.

    (I personally did not understand anything at the level of generality you are speaking.)

    Comment


    • #3
      The error message seems pretty clear: your dataset does not have value labels so there is nothing to add numbers to. You need to get the value labels (from Excel or elsewhere) before you can change them.

      Whether that is your only problem is hard to say without information on how you got the dataset from Excel into Stata, how that dataset now looks like, and how you want it to look.

      Comment


      • #4
        Let me try a guess.

        You imported data from Excel and Stata created some of your variables as strings containing things like, for example, country names.

        In the past, when you've done this, you first used encode to change string variables into numeric variables and create value labels for them as part of the process, so they still display as country names, but are actually represented as numeric values 1, 2, ... . You then use numlabel to add the numeric value to the value labels, so that you'll be able to see the numeric value along with the country name.

        This time you neglected the encode step, your variables are still strings, and there are no numeric variables with value labels to add the numeric value to.


        Comment

        Working...
        X