Last-Two Digits Test

Background: 

This script is based on Mark J. Nigrini's Forensic Analytics book -  Chapter 8 - The Last-Two Digits Test.  This test is a powerful test for number invention or number creativity.  The test identifies abnormal duplications on the right side, these duplications could indicate errors, invented numbers, or excessive rounding.  To run this test, select the file you wish to perform the test on and the amount field.  The resulting file will have 100 transactions showing the last two digits i.e. 01 to 99 and the difference with the expected rate

Documentation: 

'******************************************************************************************************

' IDEAScript :    Last-Two Digits Test.iss

' Author :           Brian Element - brian.element@ideascripting.com

' Date :              October 10, 2011

' Purpose :        To identify number invention within the database. This test looks at the

'                       last two digits of a number and compares their frequency with Benford's law.

'                       The LTDT Test is based on Chapter 8 of Nigrini, Mark J., Forensic Analytics:

'                       Methods and Techniques for Forensic Accounting Investigations,

'                       New Jersey: John Wiley & Sons, Inc., 2011: Print

'Modified:         Jan 13, 2012 - Help added to the script

'Modified:         Mar 10, 2012 - Added history and updated some of the script

'                       Mar 10, 2012 - Updated the script so the stats are calculated automatically

'*****************************************************************************************************

 

This test is based on the expected frequency of the last two digits of a number.  Per Benford's law, the Last-Two Digits Test (LTDT) should appear evenly.  This test is useful in looking for "made-up" numbers.

 

To use this script run the Last-Two Digits Test.iss.  You will have the following menu:

 

 

You first must select the file you wish to perform the analysis on.  Once the file is select you can choose the amount field to run the analysis.

 

 

The output will create a graph comparing the expected with the actual.

 

 

The database that is created will show the last two digits that were looked at, for items 0 to 9 the leading 0 has been dropped so item 0 is actually 00, item 1 is 01 and so on.  The database shows the number of times (NUMBER_OF_RECS) that that number has appeard as the last two digits, the actual is the percentage of times, so for 00 it apeared 22.9% of the time.  The next column shows us what Benford expects it to be which is 1% and the last two columns are the difference and the absolute difference between the actual and expected percentage.

 

 

Document PDF: