.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Lite 3pm" .TH Lite 3pm "2021-01-07" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Statistics::Lite \- Small stats stuff. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Statistics::Lite qw(:all); \& \& $min= min @data; \& $mean= mean @data; \& \& %data= statshash @data; \& print "sum= $data{sum} stddev= $data{stddev}\en"; \& \& print statsinfo(@data); .Ve .SH "DESCRIPTION" .IX Header "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. .PP This is also a module for dilettantes. .PP 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. .SS "\s-1NOTE\s0" .IX Subsection "NOTE" This module implements standard deviation and variance calculated by both the unbiased and biased estimators. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .ie n .IP """min(@data)"", ""max(@data)"", ""range(@data)"", ""sum(@data)"", ""count(@data)""" 4 .el .IP "\f(CWmin(@data)\fR, \f(CWmax(@data)\fR, \f(CWrange(@data)\fR, \f(CWsum(@data)\fR, \f(CWcount(@data)\fR" 4 .IX Item "min(@data), max(@data), range(@data), sum(@data), count(@data)" Returns the minimum value, maximum value, range (max \- min), sum, or count of values in \f(CW@data\fR. Undefined values are ignored. .Sp \&\f(CW\*(C`count(@data)\*(C'\fR simply returns \f(CW\*(C`scalar(@data)\*(C'\fR. .Sp \&\fBPlease note\fR that this module does \fBnot\fR ignore undefined values in your data; instead, those are \fBtreated as zero\fR. .ie n .IP """mean(@data)"", ""median(@data)"", ""mode(@data)""" 4 .el .IP "\f(CWmean(@data)\fR, \f(CWmedian(@data)\fR, \f(CWmode(@data)\fR" 4 .IX Item "mean(@data), median(@data), mode(@data)" Calculates the mean, median, or mode average of the values in \f(CW@data\fR. Undefined values are ignored. (In the event of ties in the mode average, their mean is returned.) .ie n .IP """variance(@data)"", ""stddev(@data)""" 4 .el .IP "\f(CWvariance(@data)\fR, \f(CWstddev(@data)\fR" 4 .IX Item "variance(@data), stddev(@data)" Returns the standard deviation or variance of \f(CW@data\fR for a sample (same as Excel's \s-1STDEV\s0). This is also called the Unbiased Sample Variance and involves dividing the sample's squared deviations by N\-1 (the sample count minus 1). The standard deviation is just the square root of the variance. .ie n .IP """variancep(@data)"", ""stddevp(@data)""" 4 .el .IP "\f(CWvariancep(@data)\fR, \f(CWstddevp(@data)\fR" 4 .IX Item "variancep(@data), stddevp(@data)" Returns the standard deviation or variance of \f(CW@data\fR for the population (same as Excel's \s-1STDEVP\s0). This involves dividing the squared deviations of the population by N (the population size). The standard deviation is just the square root of the variance. .ie n .IP """statshash(@data)""" 4 .el .IP "\f(CWstatshash(@data)\fR" 4 .IX Item "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. .ie n .IP """statsinfo(@data)""" 4 .el .IP "\f(CWstatsinfo(@data)\fR" 4 .IX Item "statsinfo(@data)" Returns a string describing the data set, using the values detailed above. .ie n .IP """frequencies(@data)""" 4 .el .IP "\f(CWfrequencies(@data)\fR" 4 .IX Item "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. .SS "Import Tags" .IX Subsection "Import Tags" The \f(CW\*(C`:all\*(C'\fR import tag imports all exportable functions from this module into the current namespace (use with caution). More specifically, these functions are the following: \f(CW\*(C`min\*(C'\fR, \f(CW\*(C`max\*(C'\fR, \f(CW\*(C`range\*(C'\fR, \f(CW\*(C`sum\*(C'\fR, \f(CW\*(C`count\*(C'\fR, \f(CW\*(C`mean\*(C'\fR, \&\f(CW\*(C`median\*(C'\fR, \f(CW\*(C`mode\*(C'\fR, \f(CW\*(C`variance\*(C'\fR, \f(CW\*(C`stddev\*(C'\fR, \f(CW\*(C`variancep\*(C'\fR, \f(CW\*(C`stddevp\*(C'\fR, \&\f(CW\*(C`statshash\*(C'\fR, \f(CW\*(C`statsinfo\*(C'\fR, and \f(CW\*(C`frequencies\*(C'\fR. .PP To import the statistical functions, use the import tag \f(CW\*(C`:funcs\*(C'\fR. This imports all of the above-mentioned functions, except for \f(CW\*(C`statshash\*(C'\fR, \&\f(CW\*(C`statsinfo\*(C'\fR, and \f(CW\*(C`frequencies\*(C'\fR. .PP Use \f(CW\*(C`:stats\*(C'\fR to import \f(CW\*(C`statshash(@data)\*(C'\fR and \f(CW\*(C`statsinfo(@data)\*(C'\fR. .SH "REPOSITORY" .IX Header "REPOSITORY" .SH "AUTHOR" .IX Header "AUTHOR" Brian Lalonde , \&\f(CW\*(C`stddev(@data)\*(C'\fR, \f(CW\*(C`stddevp(@data)\*(C'\fR, \f(CW\*(C`variance(@data)\*(C'\fR, \f(CW\*(C`variancep(@data)\*(C'\fR, additional motivation by Nathan Haigh, with kind support from Alexander Zangerl. .PP The project lives at https://github.com/brianary/Statistics\-Lite .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 2000 Brian Lalonde , Nathan Haigh, Alexander Zangerl, and Ton Voon. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1).