*! version 0.31

Title

strtonum -- replaces a string variable with a categorical numeric
variable with a value label.

Syntax

strtonum
varlist(min=1)
[,
options]

Main
base(#) Start value for the value label definition.
Default value is 1.

keep Option for keeping the original string variables.
The original variable is renamed with a __ prefix and placed after the new
numeric variable

label(name) specifies the name of the value label to be used
and added to if the named value label already exists

extend specifies that varname will be encoded if there are
values contained in varname that are not present in label(name)

Description

strtonum transforms a string variable into a numerical integer variable with
a value label starting with the value specified by the base option.

Default is 1.

The variable label is copied to the new variable.

Examples

`"sysuse auto, clear"'

`"strtonum make"'

Authors and support

Author:

Niels Henrik Bruun,

Aalborg University Hospital

Support:

niels.henrik.bruun@gmail.com