tests whether the vectors and are independent.

tests whether the matrices and are independent.

returns the value of .

Details and OptionsDetails and Options

  • SpearmanRankTest performs a hypothesis test on and with null hypothesis that the vectors are independent, and alternative hypothesis that they are not.
  • By default a probability value or -value is returned.
  • A small -value suggests that it is unlikely that is true.
  • The arguments and can be any real-valued vectors or matrices of equal length.
  • SpearmanRankTest is based on Spearman's rank correlation computed by SpearmanRho[v1,v2].
  • For testing matrices the test statistic is based on inner standardized spatial ranks and asymptotically follows a ChiSquareDistribution[r*s] where r and s are the dimension of and , respectively. The test is invariant under affine transformations.
  • SpearmanRankTest[v1,v2,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • SpearmanRankTest[v1,v2,"property"] can be used to directly give the value of .
  • Properties related to the reporting of test results include:
  • "DegreesOfFreedom"the degrees of freedom used in the test
    "PValue"the -value of the test
    "PValueTable"formatted table containing the -value
    "ShortTestConclusion"a short description of the conclusion of the test
    "TestConclusion"a description of the conclusion of the test
    "TestData"a list containing the test statistic and -value
    "TestDataTable"formatted table of the -value and test statistic
    "TestStatistic"the test statistic
    "TestStatisticTable"formatted table containing the test statistic
  • The following options can be used:
  • AlternativeHypothesis"Unequal"the inequality for the alternative hypothesis
    MaxIterationsAutomaticmax iterations for multivariate test
    MethodAutomaticthe method to use for computing -values
    SignificanceLevel0.05cutoff for diagnostics and reporting
  • For tests of independence, a cutoff is chosen such that is rejected only if . The value of used for the and properties is controlled by the SignificanceLevel option. By default is set to .

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Test whether two vectors are independent:

Click for copyable input
Click for copyable input
Click for copyable input

Test whether two matrices are independent:

Click for copyable input

At the level there is insufficient evidence to reject independence:

Click for copyable input
Introduced in 2012
Translate this page: