Description Usage Arguments Value References Examples
LR.dec
tests whether the first significant digits frequencies of a
sample are compatible with Benford's Law using a likelihood ratio test with
test statistic -2 logλ, where H_0: cell
probabilities follow Benford's, vs. H_1: cell probabilities are
decreasing, i.e. p_1 ≥ p_2 … ≥ p_9.
1 | LR.dec(frequencies, digits = 1:9)
|
frequencies |
Vector of multinomial frequencies. |
digits |
A significant digits vector. If unspecified, default is 1:9. |
The output is a list of 3 items: the likelihood ratio test statistic
$LR
, p-value $SL
, and a convergence number
$conv
(0 meaning successful convergence).
The convergence number indicates convergence of the numerical method used to obtain the MLEs of the cell probabilities.
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 | set.seed(123)
LR.dec((firstdigitsfreq(rnorm(100), 1)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.