MAD Comparative Benford's Law Analyzer

Compare first-digit distributions with explicit assumptions and import diagnostics

📊 Baseline Dataset (CSV/Excel)

📈 Comparison Dataset (CSV/Excel)

🔍 Analysis Settings

Exclude absolute amounts below this threshold from both datasets
Methodology, eligibility, and limitations

For first digit d, the reference probability is log10(1 + 1/d). MAD is the mean of the nine absolute differences between observed and expected proportions (not percentages). Empirical first-digit screening bands are: Close ≤ 0.006; Acceptable ≤ 0.012; Marginal ≤ 0.015; Nonconformity > 0.015. These are descriptive guidelines, not significance tests. MAD depends on sample size: true Benford data averages about 0.235/√n, and 95% of samples fall at or below about 0.351/√n. Bands are therefore not assessed below 500 records and carry a caution below 1,500; each result shows the noise level for its size.

The comparison factor is comparison MAD divided by baseline MAD, not a squared deviation. Ratios are unavailable when baseline MAD is too close to zero or dataset sizes differ by more than 2×. A MAD difference describes distance from the reference, not fraud risk or control quality, and it shifts with sample size.

The Pearson chi-square statistic uses eight degrees of freedom. Its p-value is withheld if any expected digit count is below five or a minimum-amount filter removed records. Otherwise it assumes independent observations from a population for which Benford is an appropriate reference; eligibility remains the analyst’s responsibility. Failure to detect a departure does not establish conformity.

Assess population comparability and data generation before analysis. Assigned identifiers, constrained prices, narrow amount ranges, and binding minima/maxima may not follow Benford. Arbitrary filtering can change the expected distribution. Negative values are analyzed by magnitude; zero, blank, invalid, and below-minimum values are excluded and counted.

The between-dataset result is a Pearson chi-square test of homogeneity on the 2×9 digit table, with Cramér’s V as its effect size. It assumes independent, non-overlapping records, and it is withheld for identical files or expected counts below five. When more of the amounts are shared than chance explains, the application warns, because shared records make the test conservative: a detected difference stands, while a non-detection is reported as inconclusive. Not detecting a difference does not establish that nothing changed.

For before/after versions of the same records, choose the paired design and a record ID column in each file. Records are matched by exact ID; blank or repeated IDs and unmatched records are counted and left out. The Stuart–Maxwell test asks whether first-digit changes net out, and its degrees of freedom depend on which digits are connected by changes. It needs at least 10 changed first digits and is conservative with few changes, so a non-detection then carries little weight.

Digit shifts and MAD differences are descriptive. No confidence intervals are implemented. Conformity does not establish absence of fraud; nonconformity does not establish fraud.

Text formats: decimal point with optional comma thousands grouping (1,234.56), or decimal comma with optional point grouping (1.234,56). Scientific notation and parentheses negatives are supported. Other text is rejected. Excel numeric cells retain their stored numeric values, and first digits are read after rounding to 15 significant digits to remove floating-point residue. Formula cells use cached values and are not recalculated; error cells and formulas with no cached value count as invalid. Input is limited to UTF-8 CSV or XLS/XLSX, 10 MiB, 100,000 nonblank data rows, and 256 columns.

References: NIST chi-square goodness-of-fit; Nigrini (2012), Benford’s Law: Applications for Forensic Accounting, Auditing, and Fraud Detection. The custom comparison has no claimed legal admissibility or validated fraud-risk calibration.