Title

encodel - Streamlined encode

Syntax

encodel varelist , [ label(label-name) multilabel yn]

Description

encodel is a streamlined version of encode, for bulk changing of string variables to numeric. In the default case, one set of value labels is created and assigned to all variables in varelist,
with the values and corresponding labels determined by the first variable. If multilabel is specified, each variable gets it's own set of labels.

Also, each variable in varelist is replaced with a numeric version; no new variables are generated (and no warnings are issued).

Options

label() specifies a label name. If it is not specified, the label name will be the the name of the first variable in varelist, with the suffix _enc.

multilabel overrides label(), and results in each variable in varelist being labeled independently, with it's own values, and with each label name matching its variable name, with the suffix _enc.

yn overrides both label() and multilabel. It treats all variables in varelist as yes/no variables, converts them to 0/1, and applies the value labels "No" and "Yes", with the label name "yn".

In this case, the command will convert all varieties of n, no, f, and false to 0, and all varieties of y, yes, t, and true to 1.