1. Home
  2. Reorder Factor Levels

Reorder Factor Levels

Select menu: Spread | Factor | Reorder Levels

Use this to change the association between the labels or levels of a factor and the underlying ordinal values. Any analysis or calculation involving a factor will use the current factor level/label ordering. For example, if a table is calculated using one classifying factor then the first level/label of the factor will be used for the first row of the table, and so on. By default, when a factor is created within Genstat the levels will be ordered numerically, and labels alphabetically. However, the ordering of the factor levels or labels can easily be changed using this dialog.

  1. From the menu select Spread | Factor | Reorder Levels.

Factor names

Dropdown list of the factors available within the spreadsheet.

Factor level/labels list

Displays the order of the labels/labels in the factor. Items within the list can be reordered using the buttons alongside the list.

OK Change the order of the factor and close the dialog.
Apply Change the order of the factor and leave the dialog open to select another factor to change.
Cancel Close dialog without making any changes.
Help Opens the Help for this dialog.
Top Move the selected item to the top of the list.
Up Move the selected item up one place in the list.
Down Move the selected item down one place in the list.
Bottom Move the selected item to the bottom of the list.
Sort Opens a dialog with additional facilities for reordering the levels/labels using different sorting operations.

Keyboard actions

The up and down arrows, Page Up/Down, and Home/End keys will move the selection in the list in the usual manner. When the Ctrl or Shift keys are depressed with the above cursor keys, the selected item will be moved within the list. The Esc key or Ctrl+F4 keys will cancel, and the Enter will activate the OK button. The buttons may also be activated by using the Alt+underlined letter.

Example

Four ordered categories are placed alphabetically into a factor:

Ordinal Label
1 High
2 Low
3 Medium
4 Zero

Another possible ordering for the labels would be to have Low, Medium then High. To change to this ordering the label Zero can be moved to the start of the list by selecting Zero and clicking the Top button. The label High can be moved to the bottom of the list by selecting High and clicking the Bottom button. This will now give the ordering shown below:

Ordinal Label
1 Zero
2 Low
3 Medium
4 High

Clicking OK will then make these changes in the spreadsheet.

See also

The FACSORT procedure can be used within the command language to provide reorder the levels of a factor.

Updated on January 27, 2022

Was this article helpful?