SORT Subcommand (DESCRIPTIVES command)

By default, DESCRIPTIVES lists variables in the order in which they are specified on VARIABLES. Use SORT to list variables in ascending or descending alphabetical order of variable name or in ascending or descending order of numeric value of any of the statistics.

  • If you specify SORT without any keywords, variables are sorted in ascending order of the mean.
  • SORT can sort variables by the value of any of the statistics available with DESCRIPTIVES, but only those statistics specified on STATISTICS (or the default statistics) are displayed.

Only one of the following keywords can be specified on SORT:

MEAN. Sort by mean. This is the default when SORT is specified without a keyword.

SEMEAN. Sort by standard error of the mean.

STDDEV. Sort by standard deviation.

VARIANCE. Sort by variance.

KURTOSIS. Sort by kurtosis.

SKEWNESS. Sort by skewness.

RANGE. Sort by range.

MIN. Sort by minimum observed value.

MAX. Sort by maximum observed value.

SUM. Sort by sum.

NAME. Sort by variable name.

Sort order can be specified in parentheses following the specified keyword:

A. Sort in ascending order. This is the default when SORT is specified without keywords.

D. Sort in descending order.

Example

DESCRIPTIVES VARIABLES=A B C
 /STATISTICS=DEFAULT RANGE
 /SORT=RANGE (D).
  • DESCRIPTIVES sorts variables A, B, and C in descending order of range and displays the mean, standard deviation, minimum and maximum values, range, and the number of valid cases.