Fsdb::F...atscores(3)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

✨ okay bestie, welcome to the Fsdb::F...atscores(3) manual page πŸ’– β€” it’s from User Contributed Perl Documentation, and the star of the show is dbcolstatscores.

🌸 NAME 🌸

dbcolstatscores β€” compute z-scores or t-scores for each value in a population.

πŸŽ€ SYNOPSIS πŸŽ€

dbcolstatscores [-t] [--tmean=MEAN] [--tstddev=STDDEV] column

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so dbcolstatscores computes statistics β€” z-score and optionally t-score β€” over a COLUMN of numbers. It creates new columns called "zscore" and "tscore". T-scores are only computed if you ask for them with the -t option, or if --tmean or --tstddev are explicitly specified (defaults are mean of 50, standard deviation of 10). Slay.

You may recall from your statistics class that a z-score is simply the value normalized by mean and standard deviation, so that 0.0 is the mean and positive or negative values are multiples of the standard deviation. It assumes data follows a normal (Gaussian) distribution. Literally the classic bell curve vibe.

T-score scales the z-score to match a mean of 50 and a standard deviation of 10. This program allows generalized t-scores that use any mean and standard deviation. Highkey flexible.

Other scales are sometimes used as well. The Wechsler Adult Intelligence Scale (one type of IQ test) is adjusted to a mean of 100 and a standard deviation of 15. Other tests scale to other standard deviations.

This program requires two passes over the data, and consumes O(1) memory and O(number of rows) disk space. Respect the two-pass queen πŸ‘‘.

✨ OPTIONS ✨

  • -a, --include-non-numeric β€” compute stats over all records, treating non-numeric records as zero instead of just ignoring them. No cap, that’s the whole move.
  • -t β€” compute t-scores in addition to z-scores. Obsessed.
  • --tmean MEAN β€” use the given MEAN for t-scores.
  • --tstddev STDDEV, --tsd STDDEV β€” use the given STDDEV for the standard deviation of the t-scores.
  • -f FORMAT, --format FORMAT β€” specify a printf(3)-style format for output statistics. Defaults to "%.5g".
  • -T TmpDir β€” where to put tmp files. Also uses environment variable TMPDIR if -T is not specified. Default is /tmp.

This module also supports the standard fsdb options:

  • -d β€” enable debugging output.
  • -i, --input InputSource β€” read from InputSource, typically a file name, or "-" for standard input, or (if you’re in Perl) IO::Handle, Fsdb::IO, or Fsdb::BoundedQueue objects.
  • -o, --output OutputDestination β€” write to OutputDestination, typically a file name, or "-" for standard output, or (if you’re in Perl) IO::Handle, Fsdb::IO, or Fsdb::BoundedQueue objects.
  • --autorun, --noautorun β€” by default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The --(no)autorun option controls that behavior within Perl.
  • --help β€” show help.
  • --man β€” show full manual.

πŸ“ SAMPLE USAGE πŸ“

πŸ’– Input:

#fsdb name id test1
a 1 80
b 2 70
c 3 65
d 4 90
e 5 70
f 6 90

πŸŽ€ Command:

cat DATA/grades.fsdb | dbcolstatscores --tmean 50 --tstddev 10 test1 | dbcolneaten

πŸ‘‘ Output:

#fsdb name id test1 zscore:d   tscore:d
a       1  80    0.23063  52.306
b       2  70    -0.69188 43.081
c       3  65    -1.1531  38.469
d       4  90    1.1531   61.531
e       5  70    -0.69188 43.081
f       6  90    1.1531   61.531
#  | dbcolstatscores --tmean 50 --tstddev 10 test1
#  | dbcolneaten

🌈 SEE ALSO 🌈

dbcolpercentile(1), dbcolstats(1), Fsdb, dbcolscorrelate β€” go read these next, bestie πŸ’….

🧚 CLASS FUNCTIONS 🧚

🌟 new

$filter = new Fsdb::Filter::dbcolstatscores(@arguments);

Create a new dbcolstatscores object, taking command-line arguments.

🌟 set_defaults

$filter->set_defaults();

Internal: set up defaults.

🌟 parse_options

$filter->parse_options(@ARGV);

Internal: parse command-line arguments.

🌟 setup

$filter->setup();

Internal: setup, parse headers.

🌟 run

$filter->run();

Internal: run over each row.

Copyright (C) 1991-2022 by John Heidemann <johnh@isi.edu>.

This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.


okay that’s the whole page! πŸ’– This one is perl v5.32.1, dated 2024-08-02, and it’s the Fsdb::F...atscores(3) manual β€” bye bestie! 🫢✨

πŸ“¦ where this page comes from