*! version 1.0.0 12jun2014
help mencode

Title

mencode -- Encode values using existing string variable as labels

Syntax

mencode varname, labels(varname) [labelname(string) force drop]

Description

mencode will take an existing string variable, convert it to a label
and apply that label to a numeric variable.

Arguments

varname the numeric variable to be labeled

labels(varname) the string variable containing the labels

Options

labelname(string) specifies name for the label created during the process.
Default is varname

force If labelname already exists, it will be replaced.

drop drops the string variable containing the labels

Notes

For mencode to work properly, there must be a 1:1 relationship
between the two required variables. The command currently doesn't check to
ensure a 1:1 relationship

Examples

. mencode statefips, labels(state)

. mencode statefips, labels(state) drop

. mencode statefips, labels(state) labelname(states) drop

Author

Jeremy Nighohossian

FTI Consulting