Fsdb::F...atscores(3)
β¨ 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 aprintf(3)-style format for output statistics. Defaults to"%.5g".-T TmpDirβ where to put tmp files. Also uses environment variableTMPDIRif-Tis 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, orFsdb::BoundedQueueobjects.-o,--output OutputDestinationβ write to OutputDestination, typically a file name, or"-"for standard output, or (if youβre in Perl)IO::Handle,Fsdb::IO, orFsdb::BoundedQueueobjects.--autorun,--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. The--(no)autorunoption 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.
π AUTHOR and COPYRIGHT π
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
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms