J_S_avg_dev_benford
takes any numerical vector reduces the sample to the specified number of significant digits and performs a goodness-of-fit test based on the deviation in means of the first digits' distribution and Benford's distribution to assert if the data conforms to Benford's law.J_S_avg_dev_benford(x = NULL, first_digits = 1, pvalmethod = "simulate", pvalsims = 10000)
"simulate"
is available.pvalmethod = "simulate"
.leading_digits(x,first_digits)
and pbenf(first_digits)
. The resulting statistic is normalized to [0,1]. x
is a numeric vector of arbitrary length. Values of x
should be continuous, as dictated by theory, but may also be integers.
first_digits
should be chosen so that leading_digits(x,first_digits)
is not influenced by previous rounding.pbenf