Title
labdu -- Drop unused value labels from memory or delete values from value labels
Syntax
labdu [lblname-list] [, delete keep current report dryrun]
Description
labdu drops unused value labels from memory. Optionally, values that do no occur in the current dataset are deleted from value labels. If lblname-list is not specified it defaults to all value labels in memory.
Options
delete deletes values and the associated text from value labels if values do not occur in any variable using the respective value label.
keep does not drop value labels that are currently not used from memory. May only be specified with delete.
current drops value labels not used in the current label language.
report displays dropped value label names and values that are deleted from value labels.
dryrun displays unused value labels and values that do not occur in the dataset. No value labels will be dropped and no values will be deleted. dryrun implies report.
Examples
. sysuse nlsw88 . label define unused 1 "something" . drop if race == 1 . labdu ,delete report
Saved results
labdu saves the following in r():
Macros r(dropped) dropped value labels (if dryrun is not specified) r(unused) unused value labels (only if dryrun is specified)
Acknowledgments
Option current is adopted from Jeroen Weesie's labelrename.
Author
Daniel Klein, University of Bamberg, klein.daniel.81@gmail.com
Also see
Online: label
if installed: labdel, labeldup, labutil2