Redefines a list of factors to coordinate their levels or labels (R.W. Payne).
||Whether to coordinate the factors to have the same levels, labels or (ordinal) number of levels (
||How to sort the levels or labels (
||Case to use for labels (
||Whether to remove unused levels (
||Factors to be coordinated|
||New factors, redefined to share the same levels or labels; if unset, the original
FACLEVSTANDARDIZE lets you redefine a set of factors so that they have the same set of levels or labels. The original factors are listed by the
FACTOR parameter, while the
NEWFACTOR parameter saves the redefined factors. If no
NEWFACTOR is defined for one of the factors in the
FACTOR list, the original factor itself is redefined.
FREPRESENTATION option controls whether it is the levels or labels that must be the same for the redefined factors. Alternatively, if you set
FREPRESENTATION=ordinals, the levels and labels are ignored and the factors are simply redefined so that their numbers of levels become identical. By default,
DIRECTION option controls whether the set of levels or labels for the redefined factors is sorted into ascending or descending order, or whether they are kept in the order in which they are met in the
CASE option enables you to change the case of letters in the labels. The default setting,
given, leaves the labels unchanged. So, for example,
'control' would be treated as two different labels. The available settings are:
||leaves the case of each letter exactly as given in the string;|
||changes all letters to upper case (or capitals);|
||changes all letters to lower case;|
||puts the first character in the text (if a letter) into upper case, then uses upper case only at the start of each new sentence;|
||begins each new word with a capital letter, but otherwise uses lower case.|
REMOVEUNUSED option lets you remove any levels that are defined for a factor, but are not present in its values.
FACLEVSTANDARDIZE uses the
SETCALCULATE directive to form the combined set of levels or labels,
SORT (if necessary) to sort them, and
EQUATE to transfer the values from the original to the redefined factors (matching their levels or labels as required). The cases of the labels are changed using
Any restrictions are ignored.
Commands for: Calculations and manipulation.
CAPTION 'FACLEVSTANDARDIZE example'; STYLE=meta FACTOR [LEVELS=!(14,15,16,17); VALUES=14,15,16,17] f1 FACTOR [LEVELS=!(12,13,14); VALUES=12,13,14] f2 FACTOR [LEVELS=!(11,13,15,17); VALUES=11,13,15,17] f3 FACLEVSTANDARDIZE f1,f2,f3; NEWFACTOR=g1,g2,g3 PRINT (f1,f2,f3,g1,g2,g3)2; FREPRESENTATION=6(levels,ordinals);\ FIELD=5; DECIMALS=0 FACLEVSTANDARDIZE [DIRECTION=given] f1,f2,f3; NEWFACTOR=g1,g2,g3 PRINT (f1,f2,f3,g1,g2,g3)2; FREPRESENTATION=6(levels,ordinals);\ FIELD=5; DECIMALS=0 FACTOR [LABELS=!t(d,e,f,g); VALUES=1...4] f1 FACTOR [LABELS=!t(b,c,d); VALUES=1...3] f2 FACTOR [LABELS=!t(a,c,e,g); VALUES=1...4] f3 FACLEVSTANDARDIZE [FREPRESENTATION=labels] f1,f2,f3; NEWFACTOR=g1,g2,g3 PRINT (f1,f2,f3,g1,g2,g3)2; FREPRESENTATION=6(labels,levels);\ FIELD=5 FACLEVSTANDARDIZE [FREPRESENTATION=labels; DIRECTION=given]\ f1,f2,f3; NEWFACTOR=g1,g2,g3 PRINT (f1,f2,f3,g1,g2,g3)2; FREPRESENTATION=6(labels,levels);\ FIELD=5