-------------------------------------------------------------------------------
help for labmask
-------------------------------------------------------------------------------

Assign values or value labels of one variable as value labels to another

labmask varname [if exp] [in range] , values(varname) [ lblname(lblname) decode ]

Description

labmask assigns the values (or optionally the value labels) of one variable values as the value labels of another variable varname. Any existing value labels will be overwritten. The idea behind the program name is that henceforth the face that varname presents will not be its own, but a mask borrowed from values. Thus, for example, a year variable might be coded by party winning at election and those value labels then shown as labels on a graph axis.

varname must take on integer values for the observations selected. values must not vary within groups defined by the distinct values of varname for the observations selected. However, there is no rule that the same label may not be assigned to different values of varname.

Options

values(varname) specifies a variable whose values (by default) or value labels (optionally) will be used as the value labels of varname. This is a required option.

lblname(lblname) specifies that the value labels to be defined will have the label name lblname. The default is that they will have the same name as varname.

decode specifies that the value labels of values should be used as the value labels of varname. The default is to use the values of varname.

Examples

. egen order = rank(-mpg), unique . labmask order, val(make) . label var order "Make and Model" . tabdisp order, c(mpg) . tabdisp order foreign, c(mpg)

Author

Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

Also see

Manual: [U] 15.6.3 Value labels, [R] label On-line: help for label; limits