-------------------------------------------------------------------------------
help for valtovar
-------------------------------------------------------------------------------

Title

valtovar -- Rename value labels to match variable names

Syntax

valtovar [varlist] [, display noreport] drop]

Description

For each variable a new value label becomes generated which matches the corresponding variables name. Whilst this behaviour needs more memory, it can sometimes be needed or be helpful for eg. merging data sets generated with the help of Stattransfer. It is highly recommended to clean up the memory using the drop option.

Options

display displays changes made to value labels. noreport suppresses the ValToVar report. drop drops unused labels after using valtovar.

Examples

Variable foreign got the value label origin. Using valtovar generates a new value label set based on origin, names it foreign and assigns it to the variable foreign.

. sysuse auto . valtovar foreign, dis . valtovar _all, no d

Acknowledgement

The ado is based on a suggestion by Martin Weiss on Statalist.

Author

Johannes N. Blumenberg Mannheim Centre for European Social Research University of Mannheim (Germany) johannes.blumenberg@uni-mannheim.de