Statistics.SpearmanRankCorr Method

procedure SpearmanRankCorr(const X: TVec; const Y: TVec; out Rs: Double; out hRes: THypothesisResult; out Signif: Double; var ConfInt: TDoubleArray; hType: THypothesisType; Alpha: Double);

Spearman rank correlation test.

#NameDescription
1XX dataset.
2YY dataset.
3RsReturns Spearman rank correlation coefficient.
4hResReturns the result of the null hypothesis (default assumption is there is no monotonic relation between the variables => Rs=0).
5Signif(Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true.
6ConfIntReturns the 100*(1-Alpha) percent confidence interval for the Rs coefficient.
7hTypeDefines the type of the null hypothesis (one or two - tailed, default value two-tailed).
8AlphaDefines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected.

Result: stored in self (calling object)

Remarks:

Performs the Spearman rank correlation test. Spearman rank correlation is a distribution-free analog of correlation analysis mentioned. Like regression, it can be applied to compare two independent random variables, each at several levels (which may be discrete or continuous). Unlike regression, Spearman's rank correlation works on ranked (relative) data, rather than directly on the data itself. Like the R2 value produced by regression, the Spearman's Rs coefficient indicates agreement. A value of rs near one indicates good agreement; a value near zero, poor agreement. Of course, as a distribution-free method, the Spearman rank correlation does not make any assumptions about the distribution of the underlying data.

Spearman test is a distribution free test that determines whether there is a monotonic relation between two variables (X , Y). A monotonic relation exists when any increase in one variable is invariably associated with either an increase or a decrease in the other variable.