Title
labgen2 -- Create labeled variable
Syntax
labgen2 [type] newvar[:lblname] ["]varlabel["] =exp [if] [in]
labgen2 [type] newvar[:lblname] =exp [if] [in] , definition [ equalsign noby ]
by is allowed
Description
labgen2 creates a new variable and labels it. The syntax is the same as with generate with the exception, that either a variable label, or option definition is specified additionally.
Options
definition specifies that anything on the right hand side of the equal sign is used as the variable label. This option is required if no variable label is specified.
equalsign does not strip the equal sign from the variable label. This option may only be combined with definition.
noby does not add "(by byvars)" to the variable label, if a by prefix is used and definition is specified.
Examples
. labgen2 byte foo "foobar" = (bar == 1) . labgen2 byte foo = (bar == 1) ,definition
Acknowledgments
The second syntax replicates the behavior of labgen by Nick Cox.
If a definition exceeds the length of 80 characters it is put into notes. This behavior is also borrowed from labgen.
Author
Daniel Klein, University of Bamberg, klein.daniel.81@gmail.com
Also see
Online: generate, label
if installed: labgen, vlgen, labutil2