Lite(3pm)

πŸ“¦
version 3.62 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute

πŸ’– Lite β€” the manual, but make it cute ✨

okay so bestie, you're looking at Statistics::Lite (that's the Lite(3pm) situation, perl's user-contributed perl documentation, we love her) πŸŽ€


🌸 NAME 🌸

Statistics::Lite β€” small stats stuff. that's it. that's the whole vibe. tiny. little. smol. πŸ“


✨ 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);

look at that. four lines of setup and you're already doing math. main character energy fr fr πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

okay so here's the tea β˜• β€” this module is a lightweight, functional alternative to those bigger, more complete, object-oriented statistics packages. those ones are giving enterprise, and honestly? sometimes you don't need all that.

because of that, it's likely to be better suited, in general, to smaller data sets. she's not trying to be everything. she's trying to be yours 🫢

this is also a module for dilettantes. yes bestie, that's a compliment. we're all just vibing here.

when you just want something to give you some very basic, high-school-level statistical values, without having to set up and populate an object first β€” like, you just want a number, not a whole relationship β€” this module may be useful. periodt. πŸ’–

πŸ”₯ NOTE πŸ”₯

this module implements standard deviation and variance calculated by both the unbiased and biased estimators. both!! she does both!! not me being thorough 😭


⭐ FUNCTIONS ⭐

  • min(@data), max(@data), range(@data), sum(@data), count(@data) β€” returns the minimum value, the maximum value, the range (which is max - min, yes literally subtraction), the sum, or the count of values in @data. undefined values are ignored.

count(@data) simply returns scalar(@data). no drama, no math, just counting. iconic.

please note that this module does not ignore undefined values in your data; instead, those are treated as zero. bestie i am just the messenger, this is what the page says πŸ’€
  • mean(@data), median(@data), mode(@data) β€” calculates the mean, median, or mode average of the values in @data. undefined values are ignored. (and if there's a tie in the mode average, their mean is returned β€” she compromises, she's balanced πŸ’…)
  • variance(@data), stddev(@data) β€” returns the standard deviation or variance of @data for a sample (same as Excel's STDEV). this is also called the Unbiased Sample Variance, and it 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. math said "one more thing" and here we are 🧚
  • variancep(@data), stddevp(@data) β€” returns the standard deviation or variance of @data for the population (same as Excel's STDEVP). this one involves dividing the squared deviations of the population by N (the population size). and again β€” the standard deviation is just the square root of the variance. the p is for population, iykyk 🌈
  • 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. one call, everything, obsessed 😭
  • statsinfo(@data) β€” returns a string describing the data set, using the values detailed above. she writes the summary for you, queen behavior πŸ‘‘
  • 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. counting with receipts fr fr πŸ“

πŸŽ€ Import Tags πŸŽ€

the :all import tag imports all exportable functions from this module into the current namespace (use with caution, bestie, she's loud πŸ“’). more specifically, these functions are the following: min, max, range, sum, count, mean, median, mode, variance, stddev, variancep, stddevp, statshash, statsinfo, and frequencies.

to import the statistical functions, use the import tag :funcs. this imports all of the above-mentioned functions, except for statshash, statsinfo, and frequencies. so like, the math ones. the actual number-crunchers πŸ’…

use :stats to import statshash(@data) and statsinfo(@data). just the two gossip girls, no numbers attached 🫢


πŸ¦‹ REPOSITORY πŸ¦‹

<https://github.com/brianary/Statistics-Lite>

go look, go star, go vibe ⭐


πŸ’œ AUTHOR πŸ’œ

Brian Lalonde <brian@webcoder.info>, stddev(@data), stddevp(@data), variance(@data), variancep(@data), additional motivation by Nathan Haigh, with kind support from Alexander Zangerl. 🫢

the project lives at <https://github.com/brianary/Statistics-Lite>


Copyright 2000 Brian Lalonde <brian@webcoder.info>, Nathan Haigh, Alexander Zangerl, and Ton Voon.

this library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free as in go wild, just keep the terms πŸ’–


🌈 SEE ALSO 🌈

perl(1).

and that's the whole page bestie ✨ no cap, every single detail intact. this one's from perl v5.32.0, dated 2021-01-07 β€” thank you for coming to my ted talk, mwah πŸ’…πŸŽ€πŸ¦‹πŸ’–