You are here: Commands > Statistics

Statistics

Menu: Found in the ANALYZE menu

Use the Statistics command to calculate descriptive statistics on numeric or date fields in the current table.

Statistics is frequently used to get an overview of a table before detailed processing. It can quickly highlight abnormalities in the table, which can then establish a direction for your subsequent approach or analysis.

Statistics provides the following information for numeric or date fields:

For numeric fields: Number of positive, negative and zero value records with averages and totals for each category plus the absolute value of the numeric field
For date fields: Number of valid, blank and invalid dates, average valid date value and number of weekend values

Note: Blank dates can only be assessed for physically defined date fields (excluding packed dates). Physically defined date fields are deemed blank if they solely contain blanks.

Range (the difference between the minimum and maximum numeric or date values)
Optional standard deviation of field
Highest field values in field
Lowest field values in field (lowest valid field values for date fields)
Optional calculation of standard deviation of field
Optional show only unique items for highest and lowest values

Note: In the case of date fields, the range and standard deviation are expressed as a number of days.

As well as displaying the statistical information above, Analyzer stores a number of values in special variables. See Command-created Variables for details.

This command can be auto-executed. For more information, on the Autoexecute Commands preference, see Command Options.

Parameters

In addition to the command parameters described below, the Statistics command has the following command parameters: First, If, Next, To and While. For a description of these parameters, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

On

Specifies the numeric fields or expressions for which statistics will be provided. In the command dialog, select the fields from the “Generate Statistics For” list box or click [Choose] to display the Selected Fields dialog. For more information, see Selection/Edit Dialog Boxes.

# of High/Low

Specifies the number of high and low values to retain during processing. In the command dialog, click the [More] button, then enter the number of high and low items in the “# of Hi/Lo” text box. Default: 5.

Unique Values Only

Optional parameter that causes only unique values for the High/Low values to be listed (i.e. no duplicate values).

STD (Standard Deviation)

This option is used to calculate the standard deviation of the fields specified, in addition to the other statistics. In the command dialog, click the [More] button, then check the “Standard deviation” checkbox.

Command Mode Syntax

STATISTICS <numeric-field-list|ALL>

<STD> <NUMBER n> <UNIQUE>

<IF test> <WHILE test> <FIRST|NEXT range>¿

Screen Results - Variables, Hyper-Links and Drill-Down

Variables are automatically created by the Statistics command and are often used to control the execution of procedures. To display a list of current variables, select Edit from the menu and choose Variables.

You can click on the hyper-linked number of zero value, negative value, positive value items or high/low values items in the screen tabular results to drill-down and view those records. You can also click on the number of valid, blank, invalid and weekend values for date fields to drill-down and view those records.

You can also use the Display command in command mode to display the variables created by this command. To do this, enter DISPLAY VARIABLES in the Command Log text box. Analyzer displays the result in the Command Log.

For more details, see Variables.

Examples

This example shows how to obtain statistics on inventory value field in an Inventory table. Management might want to search for unusual items, such as negative amounts, that can indicate a system control problem.

1. Open the Inventory table
2. Click the Analyze menu and select Statistics.
3. Select the inventory value from the list box and click [OK].

Analyzer displays the Statistics command results in the Command Log in tabular format.

The Statistics command results identify several significant features of this data:

Any negative values which might indicate a system problem
The five highest value items constitute a significant proportion of the total value and should therefore be verified at a physical count