Announcement

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

  • New on SSC: renlabv

    Thanks to Kit Baum a new package renlabv is available on SSC (see ssc describe renlabv).

    As a wrapper of the SSC program elabel by Daniel Klein, renlabv renames value labels to match the name(s) of the assigned variable(s). Hence, the program will require that elabel is installed. After using renlabv without specifying any variable the names of all value labels of the data set will be equal to the names of the assigned variables. By default renlabv will drop the original value labels if they are no longer assigned to any variable. Note that value labels originally not assigned to variables will not be renamed or dropped.

    Stata allows to attach a value label to several variables; this may be regarded as a feature (see the PDF documentation [D] for label). However, if for example the sign (sense) of only some items (variables) of a scale have to be recoded (e.g. reversed) such that all items correlate positively with each other, their value labels should be recoded, as well. But if only one (or only some) of the scale items have to be recoded (reversed) and the user is not aware that their value label is shared with other items it may happen that recoding this value label inadvertently recodes (reverses) the value label of the other items, as well, resulting in improper value labels for some items and consequently wrong conclusions from the analyses.

    You could use elabel to avoid this, for example
    Code:
    // recode variable "item1" and define a new value label "item1" with the old value label recoded:
    recode item1 (0=1) (1=0)
    elabel recode (item1) (0=1) (1=0), define(item1)
    
    // assign the new value label to variable "item1":
    label value item1 item1
    But you can use renlabv to avoid altogether the problem of inadvertently recoding value labels when recoding only some items of a set of items originally assigned to the same value labels. After having run renlabv you can then use the tandem of recode and elabel recode (without the option define())to safely recode some of the scale items. For example:
    Code:
    renlab
    recode item1 (0=1) (1=0)
    elabel recode (item1) (0=1) (1=0)
    Another use of renlabv might be that you import SPSS data containing variables with value labels defined into Stata: Stata will automatically generate label values named "labels0", "labels1", "labels2", etc. Running renlabv will rename them to better recognizable names since they will match the names of the assigned variables.

    The disadvantage of using renlabv is that subsequently you cannot longer use Stata's feature to relabel several variables instantaneously by redefining their common value label. If this bothers you, you can call renlabv by specifying only those variables which you actually want to recode.






Working...
X