Description:
In this tutorial we’ll show you how to change the order of data values in reports and plots in NCSS. As an example we’ll create a simple two-by-two table that relates a person’s sugar intake with how often they exercise using fictitious data. We’ll use the Contingency Tables procedure to generate the table.
Look at the row and column headers in the counts table and in the bar chart. By default, NCSS sorts the unique values and presents them in alphabetic order. This, however, might not be the order you’d like. Suppose in this case that you’d like to display the row variable with “Low” first and “High” second but leave the column variable with the current order. You can do this by entering a custom order for the row variable on the Column Info Table.
Go back to the Data Window and open the Column Info Table. Select the cell labeled Value Order that corresponds to the Row Variable, which is Sugar in this example. Click on the small button to load the Value Order Editor tool. As was mentioned earlier, by default the values are ordered alphabetically. Select Custom Order and then change the order so that Low is first and High is last. Click OK to apply the custom order.
You can edit the value order for any column right here on the Column Info table. If a cell is left blank, then the default ordering is used. The list of ordered values should be separated by commas. If you are using a computer language setting other than English that uses a comma as the decimal symbol, then the list should be separated by the computer’s specified list separator, which is usually a semicolon. Any values that are left out of the list will be added at the end in alphabetical order when the report is generated.
With the order specified, let’s recreate the two-way table of Sugar by Exercise. In the output, notice that the custom order has been applied for the row variable but the order of values for the column variable is still alphabetical.
The ordering we have set for Sugar will be used in other procedures as well when Sugar is used as an input variable. If we run a t-test on the column labeled response, for example, with Sugar as a grouping variable, then the t-test report will use the same custom ordering. In the t-test output, Low is designated as group 1 while High is designated as group two. Without custom ordering, High would have been used for group 1 and Low for group 2. If this is what you prefer, then you can simply remove the custom ordering from the Column Info Table and rerun the report.