Edit Factor Levels and Labels
See Also
This dialog can be used to change the attributes of a factor. The attributes are displayed in a spreadsheet containing 4 columns, as follows:

Ordinals - The order of the level/label in the factor.
Levels - The numerical level associated with each group in the factor.
Labels - The text label associated with each group in the factor.
Counts - The frequency of occurrence of group in the factor. (For information only).

You can reorder the groups in a factor by changing the ordinal values. The new ordinal values must specify a set of whole numbers from 1 to n, where n is the new number of groups for the factor. If the missing value code * entered as an ordinal, then that group will be deleted from the factor and a missing value will replace that group level in the data displayed in the spreadsheet.

The levels and labels can also be changed as required. If the labels column is empty then no text has yet been provided to describe each group. Deleting all the labels is equivalent to selecting the Clear Labels item from the Factor section of the Spread menu. If labels are used, then one must be provided for each group. If you try to specify labels for only some groups a warning message will be generated. The levels must be provided and a missing value is not valid for a level.

The cursor key movement for this menu is slightly different to a standard spreadsheet, in that the right/left arrow moves with a cell. Use the Tab and Back Tab (Shift+Tab) keys to move from column to column. The Shift key + up/down arrow & page up/down can be used to select individual cells. Alternatively, to select a group of cells, move the mouse to the top left of a cell, so that the cursor changes to the + icon, click down and drag to the end of the selection. A whole column can be selected by clicking on the column name.

The levels and labels can be entered from the clipboard using the Paste button or the Ctrl+V shortcut key. The selected cells can be copied to the clipboard with the Copy button or the Ctrl+C shortcut key.

The maximum length of a factor label is 60 characters.

Add

Add a new group into the factor. An extra row will be added at the bottom of the spreadsheet.

Delete

Delete a group from the factor. The group deleted is the row which currently has focus (contains the cursor). If the group already exists (i.e. is present before this menu was opened), a missing value (*) is entered into it's ordinal column and the remaining ordinals are renumbered.

Sort

Open the Sort Label/Level Order within a Factor Column menu, which can be used to sort the levels or labels.

Copy

Copy the current cell or selected cells onto the clipboard. A whole column can be selected by clicking on the column title. A selection of cells (only what can be seen on the screen) can be made by holding the mouse over the to right corner of a cell, clicking down and dragging until the cells are selected.
Note: The shift+cursor keys do not currently work in this spreadsheet.

Paste

Paste the contents of the clipboard from the current cell downwards.

OK

Use the specified ordinals, levels and labels for the factor and close the dialog.

Cancel

Close the dialog without making any changes to the factor.

See Also

The NEWLEVELS function of CALCULATE, the FACTOR directive with option [MODIFY=yes] and the FACSORT procedure can be used within the command language to provide some of this functionality.