Stata 15 help for matalabel


[M-3] matalabel -- Create column vectors in Mata containing value labels


matalabel [lblname-list] [using filename] , generate(namevec valuevec labelvec) [var]


matalabel is a programmer's command that reads the value-label information from the currently loaded dataset or from an optionally specified filename.

matalabel creates three column vectors in Mata containing the label name, numeric values, and labeled values. The names of the vectors are specified in the generate() option, which is required. Each vector has one row per mapping. The labeled values in the labelvec vector will be the full length of the label, even if they are longer than the maximum string length in Stata.

matalabel complements label, save, which produces an ASCII file of the variable labels in a format that allows easy editing of the value-label texts.

Specifying no list or _all is equivalent to specifying all value labels. Value label names may not be abbreviated or specified with wildcards.


generate(namevec valuevec labelvec) specifies the names of the three vectors that are to be created in Mata containing the label names, numeric values, and labeled values. generate() is required.

var specifies that the varlists using value label vl be returned in r(vl).

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index