help elabel functions

Title

elabel functions -- elabel (pseudo-)functions

Syntax

elabel variable
varlist
= fcn(arguments)
[ iff ]
[ , options ]

elabel define
elblnamelist
= fcn(arguments)
[ iff ]
[ , {add|modify|replace} nofix
options ]

where depending on fcn, arguments is usually

{ varlist | elblnamelist }

iff is typically elabel's iff eexp
but, depending on fcn, might be Stata's [if] [in] qualifiers

options add, modify, replace, and nofix
are those of elabel define, and options
are fcn-specific

fcn is one of

variable labels

copy(varname)

copies the variable label of varname and attaches it to
the variables in varlist.

newfcn()

user-supplied fcn

value labels

combine(elblnamelist)
[ iff eexp ]
[ , update separator(char) ]

combines the integer-to-text mappings in elblnamelist into one
set of value labels. Integer-to-text mappings are defined according
to the order of elblnamelist. Earlier integer-to-text mappings
are not overwritten by integer-to-text mappings from value labels
mentioned later.

Option update reverses the default behavior and keeps
integer-to-text mappings from value labels mentioned later.

separator(char) combines labels that are associated with the
same integer values, using char as a separator.

copy(elblname)
[ iff eexp ]

copies integer-to-text mappings from elblname. This is
a convenience function for making multiple copies of a given
value label.

encode(strvar
[ strvar ... ])
[if] [in]
[ , modify min(#) nosort ]

defines value labels from the sorted distinct values of strvar;
these value labels may be used with the encode command. The
optional if and in are Stata's qualifiers, which accept
Stata expressions and usually refer to observations in the
dataset. Unlike with Stata's encode command for variables, more
than one strvar may be specified (also see: multencode from
the SSC). Existing value labels may be modified by adding
values of strvar that are not yet present. Labels are associated
with consecutive integer values starting at 1 but skipping integer values
that are already present.

Option modify allows existing value labels to be modified. Note
that options add and replace are not allowed.

Option min(#) specifies the first integer value and defaults to
min(1).

Option nosort prevents sorting of (the levels of) strvar.

levels([ numvar ]
strvar) [if] [in]
[ , uniq force ]

defines value labels from variables, associating the (integer) values
in numvar with the text (labels) in strvar. If numvar
is omitted, the sequence 1, 2, ... is used as values. The optional
if and in are Stata's qualifiers, which accept Stata
expressions and usually refer to observations in the
dataset.

Option uniq is only allowed if numvar is not specified and
selects the distinct values (text/labels) of strvar; the resulting
labels are unique.

force allows the same values in numvar to
be associated with different text (labels) in strvar and keeps
the last observed integer-to-text mapping.

newfcn()

user-supplied fcn

Description

elabel (pseudo-)functions are used with
elabel variable or
elabel define; used with the former,
functions manipulate variable labels; used with the latter,
functions define new or modify existing value labels.

If you are interested in writing your own elabel (pseudo-)functions,
read Adding (pseudo-)functions to elabel.

Author

Daniel Klein

University of Kassel

klein.daniel.81@gmail.com

Also see

Online: label, egen

if installed: elabel