Generating statistics
Concept Information
You can generate detailed statistics on numeric and datetime fields in a table. Statistics provide an overview of a table, and can highlight abnormalities in the data, which can guide your subsequent analysis.
When you generate statistics, in addition to the standard output options, Analytics automatically creates a number of system variables that contain the output results. For more information, see Variables created by Analytics commands.
The results of generating statistics are described in the table below.
Note
All the statistics are generated for numeric fields. Only a subset of the statistics are generated for datetime fields.
Statistic name | Results |
---|---|
Range |
Numeric field:
|
Positive |
|
Negative |
|
Zeros | The number of zero values |
Totals |
|
Abs Value | The total of all values while disregarding the sign of the numbers |
Std Dev (optional) | The standard deviation from the mean value |
Median (optional) | The median value
|
Q25 (optional) | The first quartile value (lower quartile value)
|
Q75 (optional) | The third quartile value (upper quartile value)
|
Mode (optional) | The most frequently occurring value
|
Highest | The five highest values |
Lowest | The five lowest values |
Tip You can use the # of High/Low setting on the More tab in the Statistics dialog box to specify the number of high and low values that are included in the results. |
Steps
You can generate descriptive statistics on numeric and datetime fields in a table.
- Select
- On the Main tab, do one of the
following:
Select the field(s) to generate statistics on from the Statistics On list.
Click Statistics On to select the field(s), or to create an expression.
The order in which you select the fields is the order in which the columns appear in the results.
-
If there are records in the current view that you want to exclude from processing, enter a condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the specified condition.
- If you want to calculate the standard deviation for the selected field or fields, select Std Deviation.
- If you want to calculate the median, mode, and first and third quartile values for the selected field or fields, select Median, Mode, Q25, Q75.
Note
Calculating these additional statistics requires additional computer memory. You may exceed your computer's memory and get an error message if you calculate the additional statistics for very large data sets.
- Click the Output tab.
-
Select the appropriate output option in the To panel:
- Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save the results to a file than to display the results on the screen.
- Print – Select this option to send the results to the default printer.
- Graph – Select this option to create a graph of the results and display it in the Analytics display area.
- File – Select this option to save or append the results to a text file. The file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are disabled.
- Screen – Select this option to display the results in the Analytics display area.
-
If you selected File as the output type, specify the following information in the As panel:
- File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics you are using) is the only option. Saves the results to a new text file, or appends the results to an existing text file.
- Name – Enter a file name in the Name text box. Or click Name and enter the file name, or select an existing file in the Save or Save File As dialog box to overwrite or append to the file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to save or append the file in a location other than the project location. For example: C:\Results\Output.txt or Results\Output.txt.
- Local – Disabled and selected. Saving the file locally is the only option.
- Click the More tab.
-
Select the appropriate option in the Scope panel:
- All
- First
- Next
- While
Show me moreAll This option is selected by default. Leave it selected to specify that all records in the view are processed. First Select this option and enter a number in the text box to start processing at the first record in the view and include only the specified number of records. Next Select this option and enter a number in the text box to start processing at the currently selected record in the view and include only the specified number of records. The actual record number in the leftmost column must be selected, not data in the row. While Select this option to use a WHILE statement to limit the processing of records in the view based on a particular criterion or set of criteria. You can enter a condition in the While text box, or click While to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no further records are considered. You can use the While option in conjunction with the All, First, or Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or the indexed order of records in a table, and disregards any filtering or quick sorting applied to the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
- If you want to change the number of highest and lowest field values included in the results, enter the number in # of High/Low.
- If you selected File as the output type, and want to append the output results to the end of an existing text file, select Append To Existing File.
- Click OK.
- If the overwrite prompt appears, select the appropriate option.