Fsdb::F...orrelate(3)
πΈ okay bestie, welcome to the Fsdb::F...orrelate(3) page from User Contributed Perl Documentation β yes, weβre doing correlation today, and itβs lowkey iconic. π
β¨ NAME β¨
dbcolscorrelate β find the coefficient of correlation over columns. π
π¦ SYNOPSIS π¦
dbcolscorrelate column1 column2 [column3...]
πΈ DESCRIPTION πΈ
okay so dbcolscorrelate computes the Pearson coefficient of correlation over two (or more) columns.
The output is one line of correlations. periodt.
- With exactly two columns, a new column
correlationis created. slay. - With more than two columns, correlations are computed for each pairwise combination of rows, and each output column is given a name which is the concatenation of the two source rows, joined with an underscore. (yes, rows β thatβs what the page says, and weβre not arguing with it π« )
By default, we compute the population correlation coefficient (usually designated rho, Ο) and assume we see all members of the population. With --sample, we instead compute the sample correlation coefficient, usually designated r.
β οΈ be careful, bestie: the default here to full-population is the opposite of the default in dbcolstats. iykyk.
π¨ this program requires a complete copy of the input data on disk. no cap.
π OPTIONS π
--sampleβ select the sample Pearson product-moment correlation coefficient (the βsample correlation coefficientβ, usually designatedr).--no-sampleβ select the Pearson product-moment correlation coefficient (the βcorrelation coefficientβ, usually designatedΟ).--weight COLβ weight the correlation by columnCOL.-f FORMATor--format FORMATβ specify aprintf(3)-style format for output statistics. Defaults to"%.5g".-T TmpDirβ where to put tmp files. Also uses environment variableTMPDIR, if-Tis not specified. Default is/tmp.
This module also supports the standard fsdb options:
-dβ enable debugging output.-ior--input InputSourceβ read fromInputSource, typically a file name, or"-"for standard input, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-oor--output OutputDestinationβ write toOutputDestination, typically a file name, or"-"for standard output, or (if in Perl) aIO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. The"--(no)autorun"option controls that behavior within Perl.--helpβ show help.--manβ show full manual.
π SAMPLE USAGE π
Input:
#fsdb i_x i_y
10.0 8.04
8.0 6.95
13.0 7.58
9.0 8.81
11.0 8.33
14.0 9.96
6.0 7.24
4.0 4.26
12.0 10.84
7.0 4.82
5.0 5.68
Command:
cat TEST/anscombe_quartet.in | dbcolscorrelate i_x i_y
Output:
#fsdb correlation:d
0.81642
# | dbcolscorrelate i_x i_y
π SEE ALSO π
Fsdbdbcolstatscoresdbcolsregressiondbrvstatdiff
π CLASS FUNCTIONS π
new
$filter = new Fsdb::Filter::dbcolscorrelate(@arguments);
Create a new dbcolscorrelate 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 rows.
π AUTHOR and COPYRIGHT π
Copyright (C) 1998-2024 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.
π thatβs the whole page, bestie β this oneβs from perl v5.32.1, dated 2024-08-02, and itβs the Fsdb::F...orrelate(3) manual. π«Ά
π¦ 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