benfordClass | R Documentation |
Performs comprehensive Benford's Law analysis on numeric data to detect potential fraud, manipulation, or data quality issues. This implementation provides robust error handling, data validation, statistical testing, and detailed reporting for forensic data analysis.
Benford's Law states that in many naturally occurring datasets, the leading digit d occurs with probability P(d) = log₁₀(1 + 1/d). This analysis:
Validates data appropriateness for Benford analysis
Performs chi-square goodness of fit testing
Calculates Mean Absolute Deviation (MAD) for compliance assessment
Identifies suspicious patterns and outliers
Provides comprehensive statistical reporting
Generates publication-ready visualizations
A comprehensive results object containing:
Statistical analysis with chi-square test and p-values
Suspect identification with detailed risk assessment
Data quality validation and compliance metrics
Publication-ready visualization with theoretical vs. observed distributions
jmvcore::Analysis
-> ClinicoPathDescriptives::benfordBase
-> benfordClass
jmvcore::Analysis$.createImage()
jmvcore::Analysis$.createImages()
jmvcore::Analysis$.createPlotObject()
jmvcore::Analysis$.load()
jmvcore::Analysis$.render()
jmvcore::Analysis$.save()
jmvcore::Analysis$.savePart()
jmvcore::Analysis$.setCheckpoint()
jmvcore::Analysis$.setParent()
jmvcore::Analysis$.setReadDatasetHeaderSource()
jmvcore::Analysis$.setReadDatasetSource()
jmvcore::Analysis$.setResourcesPathSource()
jmvcore::Analysis$.setStatePathSource()
jmvcore::Analysis$addAddon()
jmvcore::Analysis$asProtoBuf()
jmvcore::Analysis$asSource()
jmvcore::Analysis$check()
jmvcore::Analysis$init()
jmvcore::Analysis$optionsChangedHandler()
jmvcore::Analysis$postInit()
jmvcore::Analysis$print()
jmvcore::Analysis$readDataset()
jmvcore::Analysis$run()
jmvcore::Analysis$serialize()
jmvcore::Analysis$setError()
jmvcore::Analysis$setStatus()
jmvcore::Analysis$translate()
ClinicoPathDescriptives::benfordBase$initialize()
clone()
The objects of this class are cloneable with this method.
benfordClass$clone(deep = FALSE)
deep
Whether to make a deep clone.
This function requires data with sufficient size (n ≥ 100 recommended) and appropriate distribution (positive numbers spanning multiple orders of magnitude). Small or constrained datasets may not follow Benford's Law naturally.
Benford, F. (1938). The law of anomalous numbers. Proceedings of the American Philosophical Society, 78(4), 551-572. Nigrini, M. J. (2012). Benford's Law: Applications for Forensic Accounting, Auditing, and Fraud Detection.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.