BivariateSpearmanRhoTest Method

Performs a Spearman rank-order test of association between the two variables.

Definition

Namespace: Meta.Numerics.Statistics
Assembly: Meta.Numerics (in Meta.Numerics.dll) Version: 4.2.0+6d77d64445f7d5d91b12e331399c4362ecb25333
C#
public static TestResult SpearmanRhoTest(
	IReadOnlyList<double> x,
	IReadOnlyList<double> y
)

Parameters

x  IReadOnlyListDouble
The values of the first variable.
y  IReadOnlyListDouble
The values of the second variable.

Return Value

TestResult
The result of the test.

Remarks

The Spearman rank-order test of association is a non-parametric test for association between two variables. The test statistic rho is the correlation coefficient of the rank of each entry in the sample. It is thus invariant over monotonic re-parameterizations of the data, and will, for example, detect a quadratic or exponential association just as well as a linear association.

The Spearman rank-order test requires O(N log N) operations.

Exceptions

ArgumentNullExceptionx or y is .
DimensionMismatchExceptionx and y do not contain the same number of entries.
InsufficientDataExceptionThere are fewer than three data points.

See Also