You are here: Commands > Benford

Benford

Menu: Found in the ANALYZE menu

The Benford command allows you to generate digital analysis using the Benford formula.

This command counts the number of times each leading digit or digit combination occurs in a data set and compares the actual count to the expected count. The expected count is calculated using the Benford formula. The command output can be sent to a graph.

To help you evaluate the significance of deviations between actual and expected counts, the command output includes the Z-statistic for each count. You can also use the Bounds option to help you identify digit frequencies that are significantly outside expectations. When more than one count column falls outside the bounds, the data represented by these columns may be anomalous.

For more information about digital analysis, see Digital Analysis Using Benford’s Law: Tests & Statistics for Auditors by Mark J. Nigrini, Ph.D., published by Global Audit Publications.

Note: Digital analysis tools like the Benford command enable auditors and other data analysts to focus on possible anomalies in large data sets. They do not prove that error or fraud exist, but identify items that deserve further study on statistical grounds. Digital analysis complements existing analytical tools and techniques and should not be used in isolation from them.

Parameters

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

On

Allows you to specify a numeric field as the Benford key field. In the command dialog, select the field from the “Benford key field” pull-down list or click [Choose] to display the Selected Fields dialog. You can then select a field from the Available Fields list box or use an expression to create the values to be analyzed. For more information on the Selected Fields dialog, see Selection/Edit Dialog Boxes.

Bounds

Allows you to include upper and lower bounds in your output. In the command dialog check the “Include upper and lower bounds” checkbox.

Leading

Allows you to specify the number of leading digits to be analyzed. Enter a value from 1 to 6. In the command dialog, enter the value in the “Number of leading digits” text box.

For example, if a numeric field called Amount contains the value $-6,234.56, the value analyzed is:

623 if Leading Digits = 3

62345 if Leading Digits = 5

If a numeric field called Amount contains the value $3.55, the value analyzed is:

355 if Leading Digits = 3

35500 if Leading Digits = 5

Input

This command analyzes numeric fields. You can specify up to six leading digits to be analyzed. When there are more than three leading digits, Benford analysis must be sent to a file. Analysis of five or more leading digits takes time and Analyzer notifies you in the Command Log that it is working. Use the Esc key to terminate the command at any time before results appear in the Command Log.

Effective Benford analysis requires large sample sizes. Analyzer warns you when a sample size may be too small for the specified number of digits.

Anomalous data stands out better when you analyze positive and negative values separately. You can use a filter to separate the two before beginning your analysis. Digits or digit combinations with zero values are automatically excluded.

The Benford command ignores records with values of zero, but reports the number of zero value records bypassed. It also ignores leading zeros, numeric formatting such as decimals and dollar signs and other non-numeric digits. If the resulting number of digits is less than specified, Analyzer adds zeros to the right of the result.

Command Output

The default output is to the Command Log in tabular format. You can also send output to a file or to a line graph or 2-D bar graph.

Table Output

The table contains four columns: Leading Digits, Actual Count, Expected Count and Z-Stat Ratio. If you select the bounds option, the table contains two additional columns, Lower Bound and Upper Bound.

No output is produced for records that fail to meet test criteria or for records that contain only zeros.

The Leading Digits column shows the leading digits tested. For example, if you specify one leading digit, Leading Digits displays the numbers 1 to 9. If you specify two leading digits, Leading Digits displays the numbers 10 to 99.

The Actual Count column shows the count of each leading digit or leading digit combination found in the population.

The Expected Count column shows the count calculated according to the Benford formula.

The Z-Stat Ratio column shows the Z-statistic for each digit combination. See ZSTAT().

Graph Output

The graph shows actual count, expected Benford count and the upper and lower bounds if the Include Upper and Lower Bounds checkbox on the [Main] dialog is selected. Analysis of a single leading digit produces 9 data points on the x-axis, two leading digits produces 90 points, three leading digits produces 900 points and so on.

An alternate way to create a graph is to simply double-click the command or table output in the Command Log. For more information, see Graph Output.

Command Mode Syntax

BENFORD ON numeric-field

<LEADING n> <BOUNDS>

<TO data-file_name|SCREEN|GRAPH>

<IF condition> <WHILE condition> <FIRST|NEXT n>

<NOFORMAT> <APPEND>¿

numeric field specifies the numeric field to analyze.
LEADING <n> specifies the number of leading digits to be analyzed. Assign n a positive value of 1 to 6. The default is 1.
BOUNDS includes the upper and lower bounds in the output.

Examples

To perform a Benford analysis on the amount field to two digits and include bounds:

BENFORD ON Amount LEADING 2 BOUNDS TO SCREEN

The results appear in the Command Log or can be graphed.