Euclidean_dist_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 Euclidean distance between the first digits' distribution and Benford's distribution to assert if the data conforms to Benford's law.Euclidean_dist_benford(x = NULL, first_digits = 1, pvalmethod = "simulate", pvalsims = 10000)
"simulate"
is available.pvalmethod = "simulate"
.leading_digits(x,first_digits)
and pbenf(first_digits)
. 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