Obtains the labels for a factor if it has been defined with labels, or constructs labels from its levels otherwise (V.M. Cave).
|Controls printed output (
||Supplies a single line of text to be used as a prefix when constructing labels from the factor levels; default
||Factor whose labels are to be obtained|
||Specifies text structures to save the labels of each factor|
||Specifies a scalar for each factor, set to the value 1 if its labels already existed or 0 if they had to be constructed|
FACGETLABELS can be used to obtain the labels of a factor. If the factor has been defined without any labels, they are constructed from its levels.
The factor whose labels are to obtained (or constructed) is specified using the
FACTOR parameter. The
LABELS parameter can be used to save the labels in a text structure. The
EXIST parameter can save a scalar that indicates whether the labels already existed (= 1), or had to be constructed (= 0).
labels to print the resulting labels; by default, nothing is printed. The
PREFIX option can supply a text containing a single string, to be used as a prefix when constructing labels from factor levels. The string is inserted before the level numbers to form the labels. For factors with defined labels,
PREFIX is ignored.
Any restrictions on the factors supplied by
FACTOR are ignored.
CAPTION 'FACGETLABELS example'; STYLE=meta "Factor with labels defined" FACTOR [LEVELS=2; LABELS=!T(male,female)] Sex; VALUES=!T(4(male,female)) FACGETLABELS [PRINT=labels] Sex; LABELS=LabelsSex "Factor without labels defined" FACTOR [LEVELS=!(2,4,8,16); VALUES=8,4,2,16,4,2,16,8,2] Dose FACGETLABELS [PRINT=labels] Dose; LABELS=LabelsDose "Add preceding text when creating factor labels from levels" FACGETLABELS [PRINT=labels; PREFIX='Rate '] Dose; LABELS=LabelsDose