GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
basic-stats(1) FreeBSD General Commands Manual basic-stats(1)

basic-stats - Command-line statistics made trivial

basic-stats z-score x mean stddev
basic-stats z-cdf z-score [mean stddev] (defaults: 0 1)
basic-stats t-score x-bar expected-mean stddev n
basic-stats [--verbose] [--delim string] \
	    function1 [param1] --row|--col N \
	    [function2 ...]

Echo input data during processing

Use string as a set of delimiters instead of the default " \t"

Compute statistics for row N (1-based) of the input

Compute statistics for column N (1-based) of the input

Compute the mean (average) for row/column N

Compute the low, high, and quantiles for row/column N

Compute the low, high, and median for row/column N. Identical to quantile 2 --row|--col N.

Identical to quantile 4 --row|--col N.

Report population variance

Report population standard deviation

Report population z-scores

Report sample variance

Report sample standard deviation

Report sample z-scores. Should only be used for sample sizes of 30 or more. Otherwise, use sample-t-score.

Report sample standard error (sigma-x-bar = stddev / sqrt(n))

Report t-score for sample data.

Report mode

Report range

Report interquartile range

Basic-stats is a program for quickly computing statistics on tabular data from the command-line. It elimintes the nuisance of importing data into a spreadsheet or writing custom scripts in order to gather basic statistics.

Basic-stats computes common statistics such as mean, median, etc. on rows and/or columns of tabular data. It can compute multiple functions on multiple rows and/or columns in a single pass through the input stream.

The default delimiter is either a single TAB or multiple space characters. Alternate delimiters, such as a comma, can be specified using, e.g. --delim ','.

Quantiles are computed using a generalized interpolation formula (method 4 from the Wikipedia page on quartiles).

The output format is designed to be both human-readable and easily parsed by command-line tools and scripts.

Basic-stats is written entirely in C for maximal performance. Memory use is trivial for many functions, but some computations such as quantiles which involve sorting the data require the use of arrays.

> cat sample.txt    
1    5  21
2   12  22
3   13  23
4   14  24
5   15  25
6   16  26
7   17  27
8   18  28
9   19  29
10  20  30
> basic-stats mean --col 1 median --row 2 quantile 4 --col 3 < sample.txt
Col 1 mean           5.500000
Row 2 low            2.000000
Row 2 quantile(0.50) 12.000000
Row 2 high           22.000000
Col 3 low            21.000000
Col 3 quantile(0.25) 22.750000
Col 3 quantile(0.50) 25.500000
Col 3 quantile(0.75) 28.250000
Col 3 high           30.000000

awk(1), R(1)

Please report bugs to the author and send patches in unified diff format. (man diff for more information)

J. Bacon

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.