Announcement

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

  • Identifying the value label of a variable

    I want to write a simple code that goes through a list of variables and drops the value labels for those variables. I am finding this hard because there doesn't seem to be any way to identify the value label of a variable. And the "label drop" command requires knowing the name of the value label assigned to that variable.

    I know how to identify the label of the variable, like this:

    local varlabel: var label variable

    But I can't figure out how to do this for value labels.

    Thanks!

  • #2
    Use ds or findname (SJ) to identify variables with value labels, with particular value labels, etc.

    http://www.stata.com/help.cgi?extended_fcn tells you about

    Code:
    valuelabelvarname
    which is documented next to the construct you mention.

    Comment


    • #3
      Note that if by "drop" you mean you want to remove the value labels from the variables in question the following does it without knowing the name of the value label (note the "." at the end of the command, see help labels for documentation).
      Code:
      label values frog toad .

      Comment

      Working...
      X