Description Usage Arguments Details Value References Examples
LR.mat.mult
is a likelihood ratio test for whether the first
significant digits of a set of samples are compatible with Benford's Law,
where H_0: cell probabilities follow Benford's, vs. H_1: the most
general multinomial, i.e. all probabilities non-negative,
sum to 1.
1 | LR.mat.mult(freq, digits = 1:9)
|
freq |
Vector or matrix with multinomial samples in the rows. |
digits |
A significant digits vector. If unspecified, default is 1:9. |
The LR statistic λ for testing H_0 vs. H_1 is:
-2logλ = -2 ∑ f_i{log(p_i) - log(f_i/n)}
where f_i is the frequency of the ith first digit, and p_i is the cell probability of the ith first digit.
The output is a vector of p-values, one per sample (row).
Lesperance M, Reed WJ, Stephens MA, Tsao C, Wilton B (2016) Assessing conformance with Benford's Law: goodness-of-fit tests and simultaneous confidence intervals. PLoS one; 11(3). Wong, S. (2010) Testing Benford's Law with the first two significant digits. University of Victoria, Master's thesis.
1 2 3 | LR.mat.mult(firstdigitsfreq(c(0.41, 1.25, 0.21, 0.54, 0.19), 1))
set.seed(123)
LR.mat.mult(firstdigitsfreq(rnorm(100), 1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.