help elabel duplicates

Title

elabel duplicates -- Report or remove duplicate value labels

Syntax

Report duplicate value labels

elabel duplicates [ report
[ elblnamelist ]]

Remove duplicate value labels

elabel duplicates remove
elblnamelist

elabel duplicates retain
elblname
[ elblname ... ]

Description

elabel duplicates reports or removes duplicate value labels. Duplicate
value labels define the same integer-to-text mappings.

elabel duplicates report finds and reports (groups of) duplicate value
labels among the value labels in elblnamelist or, if elblnamelist
is not specified, among all value labels in memory. To find all duplicates
of a specific value label, specify exactly one value label name. Results are
returned in r().

elabel duplicates remove removes all but the first value label
(in each group) of duplicate value labels among the value labels in
elblnamelist. Duplicate value labels are detached from variables
and dropped from memory (see elabel remove). The
retained value labels in each group are attached to variables that
previously had one of the duplicated value labels attached.

elabel duplicates retain removes all duplicates of the specified
value labels. Duplicate value labels are detached from variables and
dropped from memory (see elabel remove). The retained
value labels are attached to variables that previously had one of the
duplicates attached. The specified value label names may not define
duplicate value labels.

Examples

Setup

. sysuse nlsw88

. label define southlbl 0 "no" 1 "yes"

. label values south southlbl

. label define c_citylbl 0 "no" 1 "yes"

. label values c_city c_citylbl

. describe south c_city

Find and report duplicate value labels

. elabel duplicates report

Create one more duplicate value label

. label define yesno 0 "no" 1 "yes"

Retain value label yesno and drop southlbl and c_citylbl

. elabel duplicates retain yesno

. describe south c_city

Saved results

elabel duplicates report saves the following in r():

Scalars

r(N_duplicates) number of (groups of) duplicate
value labels

r(n_duplicates#) number of value
labels in group #; 0<#<=r(N_duplicates).

Macros

r(duplicates#) duplicate value
labels in group #; 0<#<=r(N_duplicates).

Author

Daniel Klein

University of Kassel

klein.daniel.81@gmail.com

Also see

Online: label

if installed: elabel,
elabel compare,
labeldup