Scroll to navigation

ST(1) User Contributed Perl Documentation ST(1)

NAME

st-console - simple statistics from the command line interface (CLI)

DESCRIPTION

"st-console" is a command-line tool to calculate simple statistics from a file or standard input.

USAGE

  st-console [options] [input_file]

OPTIONS

FUNCTIONS

  --N|n|count           # sample size
  --min                 # minimum
  --max                 # maximum
  --mean|average|avg|m  # mean
  --stdev|sd            # standard deviation
  --stderr|sem|se       # standard error of mean
  --sum|s               # sum of elements of the sample
  --variance|var        # variance

The following options require that the whole dataset is stored in memory, which can be problematic for huge datasets:

  --q1                  # first quartile
  --median|q2           # second quartile, or median
  --q3                  # third quartile
  --percentile=f        # percentile=<0..100>
  --quartile=i          # quartile=<1..4>

If no functions are selected, "st-console" will print the default output:

    N     min  max  sum  mean  stddev

You can also use the following predefined sets of functions:

  --summary   # five-number summary (min q1 median q3 max)
  --complete  # everything

FORMATTING

    --format|fmt|f=<value>  # default: "%g"

Examples of valid formats:

      %d    signed integer, in decimal
      %e    floating-point number, in scientific notation
      %f    floating-point number, in fixed decimal notation
      %g    floating-point number, in %e or %f notation
  --delimiter|d=<value>   # default: "\t"
  --no-header|nh          # don't display header
  --transpose-output|to   # switch rows and columns

INPUT VALIDATION

By default, "st-console" skips invalid input with a warning.

You can change this behavior with the following options:

  --strict   # throws an error, interrupting process
  --quiet|q  # no warning

AUTHOR

Nelson Ferraz <nferraz@gmail.com>

CONTRIBUTE

Send comments, suggestions and bug reports to:

https://github.com/nferraz/st/issues

Or fork the code on github:

https://github.com/nferraz/st

THANKS

imurray, who suggested a different algorithm for calculating variance.

asgeirn, who suggested a input filter and helped to remove some warnings.

gabeguz, who modified the script to make it more portable.

COPYRIGHT

Copyright (c) 2013 Nelson Ferraz.

This program is free software; you can redistribute it and/or modify it under the MIT License (see LICENSE).

2019-12-03 perl v5.30.0