Correlation
relate_correlation
Works out the Pearson and Spearman correlation between X and Y.
- Runs
- Built, not hosted
- Level
- Checked against a reference: R 4.4.3
From server 1.0.0 this tool is called stats_correlation. Until then it answers as relate_correlation.
What it is
Required: unit (unspecified, replicates, rows, serial, technical). Computes Pearson r and r-squared (with t test and Fisher-z interval) and Spearman rho (with exact, Edgeworth, or t p-value and cleared interval). Inference opens only for replicate or row units.
Field: Statistics. It is the same calculation as Drybench Assay, called by an AI assistant through the server.
What it does
You give
x(required): X per row, in its own unit; null for a blank.y(required): Y per row: a number, null (blank), or an array of replicate values for that row.unit(required): What one point is (required; never inferred): 'replicates' (each replicate an independent unit), 'rows' (each row an independent unit, replicates technical: row means are used), 'serial' (serial reads of one unit), 'technical', or 'unspecified'. Inference needs 'replicates' or 'rows'.xLabel: Optional name of X.yLabel: Optional name of Y.level: Confidence coverage level for intervals (0.9, 0.95 default, or 0.99).
Asked with
- xLabel
- Protein (ug)
- yLabel
- Signal
- unit
- rows
- level
- 0.95
It answered (computed)
Computed by this tool when the page was built. The steps between are not recorded, so this is not a worked example. The reply carries more values than are shown here.
Limits
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
- No other limit is recorded for this tool.
Every input, with its units6 inputs
x(required): X per row, in its own unit; null for a blank.y(required): Y per row: a number, null (blank), or an array of replicate values for that row.unit(required): What one point is (required; never inferred): 'replicates' (each replicate an independent unit), 'rows' (each row an independent unit, replicates technical: row means are used), 'serial' (serial reads of one unit), 'technical', or 'unspecified'. Inference needs 'replicates' or 'rows'.xLabel: Optional name of X.yLabel: Optional name of Y.level: Confidence coverage level for intervals (0.9, 0.95 default, or 0.99).
The calculation
The method's equations, constants and worked example.
No equation is recorded for this version.
Kind of method: not recorded.
Worked example: not recorded for correlation-pearson-spearman@1.1.1.
Sources
No source is recorded for this tool's methods.
How it is checked
- Level
Checked against a reference.
- Checked against
R 4.4.3 (cor.test, Pearson and Spearman; Bonett–Wright written in R) on the 26 correlation cases of the 0.11.0 fixture: r, ρ, S and t within 1e-10 relative, t-based p within 1e-8 relative, Edgeworth p within 1e-10 relative, exact p within 1e-12 absolute, Fisher and Bonett–Wright bounds within 1e-9 absolute, Spearman's p path and withheld states exact; SciPy 1.13.1 agrees on all 30 of the quantities it computes. Simulated coverage of the Spearman interval at 95 percent (20,000 replicates per cell): 94.2 to 96.8 percent in all 24 untied cells, inside the 0.93 to 0.97 gate; tied cells fell as low as 45.6 percent, so the interval is withheld with ties; at 90 and 99 percent it is not simulated and is withheld (2026-10-13).
- Cases
No case set is linked to this version.
- Hostile inputs
Sent 94 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason.
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Same answer
Called twice and with its arguments in another order, it gave the same result.
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Not checked
Not recorded. Its absence does not mean everything was checked.
What this project's records still lack5 things
- A case worked by hand from the source's equation for correlation-pearson-spearman@1.1.1.
- The equation for correlation-pearson-spearman@1.1.1.
- The constants with their sources for correlation-pearson-spearman@1.1.1.
- A case set linked to this version for correlation-pearson-spearman@1.1.1.
- A record of what was not checked for correlation-pearson-spearman@1.1.1.
Cite a number from this toolthe cite line
Every reply carries a cite line naming the tool, the server version, each method with its version and level, and the receipt. Quote it with any number taken from the reply.
relate_correlation, server 1.0.0; correlation-pearson-spearman@1.1.1 (Checked against a reference); receipt 894360185a46/a258d1fd92d0; methods https://www.drybench.com/methods/assay; page https://www.drybench.com/methods/tools/relate-correlation. Quote this line with any number taken from this reply.Changes to its methods1 change
- 18 November 2026, correlation-pearson-spearman@1.1.1: In 1.1.1 each variable is divided by a power of two near its largest absolute value before its mean is formed, and each centred vector again before any product. r is unchanged by a positive scale of either variable, and a power of two scales a double exactly, so only inputs that overflowed or underflowed move. x = [0, 0, 1e200], y = [0, 1, 2] now gives r 0.8660254037844386, r² 0.75, t 1.7320508075688772 and p 0.3333, as R's cor.test, SciPy's pearsonr and 50-digit arithmetic do.