Edit Factor Levels

It allows you to edit the numeric value associated with each ordinal level of the factor. This menu is also available via the Levels button on the Column Attributes/Format dialog.

A factor always has a specified number of levels N. The only values that it is permitted to have are integers in the range 1...N or missing value. The associated levels are a mapping to real numbers that can be used for input or output of factor values, or in calculations. For example, a factor with three levels may represent drug dosage at 0.0, 5.0, and 10.0 mg. A factor can also have textual labels associated with each ordinal level, in this example these could be 'placebo','low' and 'high'.

When a variate column is converted to a factor, the distinct values will be identified and set up as the initial set of levels. Labels will also be created, having the same values in text form.

Edit Factor Levels allows you to edit the current values, add new levels or remove unwanted levels. To edit a value you select it within the list box. It can then be changed in the box above; press return to commit the change. The Add button will create a new level, and increase the number of levels (N) by one. The new level will default to its ordinal value, N, which you can then edit if required. (If the factor also has associated labels a new label will also be generated having the number N in text form, e.g. '10'.) The Delete button removes the currently selected level from the factor. Any cells in the spreadsheet column that have this value will be changed to missing (*).

The factor levels can be copied to or pasted from the clipboard using the Copy and Paste buttons respectively. The presently selected level and those below will be copied to/pasted from the clipboard. When pasting from the clipboard, if there are more items on the clipboard than in the label list, the extra items from the clipboard will be added at the end of the factor level list.

When you have finished editing the factor levels, click OK to return to Column Attributes/Format or Cancel if you want to discard the changes.

Note: The short cut key Control+F12 can be used to place the factor levels or labels (whatever is currently being displayed) of the current column on to the clipboard. The clipboard can then be pasted into another factor with the Paste button above or into a text edit window with the Edit | Paste (Ctrl+V) command.

See Also

Edit Factor Labels
Edit Factor Levels and Labels
Spreadsheet Factor Menu
Reorder Factor Levels
Change Factor Levels and Labels for more complex operations on levels and labels, including merging levels, removing unused levels, and remapping the ordinal values.
Spreadsheet Factor Menu

Factor levels can be changed using the options [Levels=Variate;MODIFY=yes] of the FACTOR directive in the command language. However the number of levels cannot be changed or the data will be lost.