Fsdb::F...orrelate(3)

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

🌸 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 correlation is 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 designated r).
  • --no-sample β€” select the Pearson product-moment correlation coefficient (the β€œcorrelation coefficient”, usually designated ρ).
  • --weight COL β€” weight the correlation by column COL.
  • -f FORMAT or --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 or --input InputSource β€” read from InputSource, typically a file name, or "-" for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • -o or --output OutputDestination β€” write to OutputDestination, typically a file name, or "-" for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • --autorun or --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 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 🌈

  • Fsdb
  • dbcolstatscores
  • dbcolsregression
  • dbrvstatdiff

πŸ‘‘ 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.

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