FACAMEND procedure

Permutes the levels and labels of a factor (J.T.N.M. Thissen).


Option

DIRECTION = string
Order into which to sort the levels or labels of FACTOR (ascending, descending); default asce


Parameters

FACTOR = factor
Factor whose levels or labels are to be permuted

NEWLEVELS = variate or text
To specify the new order of the factor levels or labels


Description

Occasionally a clear presentation of results requires permutation of factor levels. For example, describing the interaction between two qualitative factors you may want to change the order of the factor levels to clarify the interaction structure.

   The factor whose levels are to be permuted must be specified using the FACTOR parameter. The new order of the factor levels can be specified using the NEWLEVELS parameter, either by way of the numerical levels (in a variate) or by the labels (in a text).

   If the NEWLEVELS parameter is not specified and the factor has labels, the levels are sorted so that these are in alphabetic order. If NEWLEVELS is not set and there are no labels, the levels of the factor are put into numerical order. The DIRECTION option determines whether the sort is into ascending or descending order; by default DIRECTION=ascending.


Option: DIRECTION. Parameters: FACTOR, NEWLEVELS.


Method

The procedure uses the SORT directive and a new factor declaration to change the order of the factor levels or labels.


Action with RESTRICT

Restrictions are not allowed.