

$stats = Statistics::Benford><B>newB>  
$stats = Statistics::Benford><B>newB>($base, $pos, $len) 
Creates a new Statistics::Benford object. The constructor will accept the
number base, the position of the significant digit in the number to examine,
and the number of digits starting from that position.
The default values are: (10, 0, 1). 
%dist = $stats><B>distB>($bool)  
%dist = $stats><B>distributionB>($bool)  Returns a hash of the expected percentages. 
$diff = $stats><B>diffB>(%freq)  
$diff = $stats><B>differenceB>(%freq)  
%diff = $stats><B>diffB>(%freq);  
%diff = $stats><B>differenceB>(%freq)  Given a hash representing the frequency count of the digits in the data to examine, returns the percentage differences of each digit in list context, and the sum of the differences in scalar context. 
$diff = $stats><B>signifB>(%freq)  
$diff = $stats><B>zB>(%freq)  
%diff = $stats><B>signifB>(%freq);  
%diff = $stats><B>zB>(%freq) 
Given a hash representing the frequency count of the digits in the data to
examine, returns the zstatistic of each digit in list context, and the
average of the zstatistics for all the digits in scalar context.
The zstatistic shows the statistical significance of the difference between the two proportions. Significance takes into account the size of the difference, the expected proportion, and the sample size. Scores above 1.96 are significant at the 0.05 level, and above 2.57 are significant at the 0.01 level. 
# Generate a list of numbers approximating a Benford distribution. my $max = 10; # numbers range from 0 to 10 my @nums = map { ($max / rand($max))  1 } (1 .. 1_000); my %freq; for my $num (@nums) { my ($digit) = $num =~ /([19])/; # find first nonzero digit $freq{$digit}++; } my $stats = Statistics::Benford>new(10, 0, 1); my $diff = $stats>diff(%freq); my $signif = $stats>signif(%freq);
<http://en.wikipedia.org/wiki/Benford’s_law>
When counting the first digit, make sure it is nonzero. For example the first nonzero digit of 0.038 is 3.Convert nondecimal base digits to decimal representations. For example, to examine the first two digits of a hexadecimal number, like A1B2, take the first two digits ’A1’, and convert them to decimal 161.
The law becomes less accurate when the data set is small.
The law does not apply to data sets which have imposed limitations (e.g. max or min values) or where the numbers are assigned (e.g. ids and phone numbers).
The distribution becomes uniform at the 5th significant digit, i.e. all digits will have the same expected frequency.
It can help to partition the data into subsets for testing, e.g. testing negative and positive values separately.
Please report any bugs or feature requests to <http://rt.cpan.org/Public/Bug/Report?Queue=StatisticsBenford>. I will be notified, and then you’ll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Statistics::BenfordYou can also look for information at:
o GitHub Source Repository o AnnoCPAN: Annotated CPAN documentation o CPAN Ratings o RT: CPAN’s request tracker <http://rt.cpan.org/Public/Dist/Display.html?Name=StatisticsBenford>
o Search CPAN
Copyright (C) 20072009 gray <gray at cpan.org>, all rights reserved.This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
gray, <gray at cpan.org>
perl v5.20.3  STATISTICS::BENFORD (3)  20090906 
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.