NAME
Statistics::Lite - Small stats stuff.
SYNOPSIS
use Statistics::Lite qw(:all);
$min= min @data;
$mean= mean @data;
%data= statshash @data;
print "sum= $data{sum} stddev= $data{stddev}\n";
print statsinfo(@data);
DESCRIPTION
This module is a lightweight, functional alternative to larger, more complete, object-oriented statistics packages. As such, it is likely to be better suited, in general, to smaller data sets.
This is also a module for dilettantes.
When you just want something to give some very basic, high-school-level statistical values, without having to set up and populate an object first, this module may be useful.
NOTE
This version now uses unbiased estimators (previous versions used biased estimators) for variance and standard deviation. To get the same biased stddev() and variance() available in previous versions, simply add a zero to the data set:
$stddev_biased= stddev 0, @data;
FUNCTIONS
min(@data),max(@data),range(@data),sum(@data),count(@data)-
Return the minimum value, maximum value, range (max - min), sum, or count of values in
@data. (Count simply returnsscalar(@data).) mean(@data),median(@data),mode(@data)-
Calculates the mean, median, or mode average of the values in
@data. (In the event of ties in the mode average, their mean is returned.) variance(@data),stddev(@data)-
Return the standard deviation or variance of
@data. statshash(@data)-
Returns a hash whose keys are the names of all the functions listed above, with the corresponding values, calculated for the data set.
statsinfo(@data)-
Returns a string describing the data set, using the values detailed above.
frequencies(@data)-
Returns a hash, the keys are the distinct values in the data set, and the values are the number of times that value occurred in the data set.
Import Tags
The :all import tag imports all functions from this module into the current namespace (use with caution). To import the individual statistical funcitons, use the import tag :funcs; use :stats to import statshash(@data) and statsinfo(@data).
AUTHOR
Brian Lalonde <brian@webcoder.info>, frequencies(@data) by Nathan Haigh.
SEE ALSO
perl(1).
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 202:
You forgot a '=back' before '=head2'
- Around line 209:
=back without =over