Tests whether x and y are correlated, using Pearson's r or Spearman's rho.
const x = [2.1, 3.4, 1.9, 5.6, 4.2, 3.3];const y = [1.8, 3.9, 2.2, 5.1, 3.6, 3.5];correlationTest({ x, y }); // PearsoncorrelationTest({ x, y, method: "spearman" }); // Spearman, based on ranks Copy
const x = [2.1, 3.4, 1.9, 5.6, 4.2, 3.3];const y = [1.8, 3.9, 2.2, 5.1, 3.6, 3.5];correlationTest({ x, y }); // PearsoncorrelationTest({ x, y, method: "spearman" }); // Spearman, based on ranks
Tests whether x and y are correlated, using Pearson's r or Spearman's rho.