CorrelationTest

CorrelationTest[{{x1,y1},{x2,y2},}]
tests whether the correlation coefficient for a bivariate population is zero.

CorrelationTest[{{x1,y1},{x2,y2},},ρ0]
tests whether the correlation coefficient is .

CorrelationTest[{{x1,y1},{x2,y2},},{{u1,v1},{u2,v2},}]
tests whether the correlation coefficients for two populations are equal.

CorrelationTest[,"property"]
returns the value of .

Details and OptionsDetails and Options

  • CorrelationTest[{{x1,y1},{x2,y2},},ρ0] performs a hypothesis test on the bivariate sample with null hypothesis that the population correlation coefficient , and alternative hypothesis that .
  • CorrelationTest[{{x1,y1},{x2,y2},},{{u1,v1},{u2,v2},}] performs a hypothesis test on the bivariate samples with null hypothesis that the population correlation coefficients , and alternative hypothesis that .
  • By default, a probability value or -value is returned.
  • A small -value suggests that it is unlikely that is true.
  • The data and can be any real-valued bivariate matrices.
  • The argument can be any real number such that .
  • CorrelationTest[{{x1,y1},{x2,y2},},ρ0] will choose the most powerful test that applies to the data.
  • CorrelationTest[,All] will choose all tests that apply to the data.
  • CorrelationTest[,"test"] reports the -value according to .
  • The following tests can be used:
  • "PearsonCorrelation"based on Pearson product-moment
    "SpearmanRank"based on Spearman's
  • The test assumes the data was drawn from a normal distribution.
  • CorrelationTest[,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • CorrelationTest[,"property"] can be used to directly give the value of .
  • Properties related to the reporting of test results include:
  • "AllTests"list of all applicable tests
    "AutomaticTest"test chosen if Automatic is used
    "PValue"list of -values
    "PValueTable"formatted table of -values
    "ShortTestConclusion"a short description of the conclusion of a test
    "TestConclusion"a description of the conclusion of a test
    "TestData"list of pairs of test statistics and -values
    "TestDataTable"formatted table of -values and test statistics
    "TestStatistic"list of test statistics
    "TestStatisticTable"formatted table of test statistics
  • The following options can be used:
  • AlternativeHypothesis"Unequal"the inequality for the alternative hypothesis
    SignificanceLevel0.05cutoff for diagnostics and reporting
    VerifyTestAssumptionsAutomaticwhat assumptions to verify
  • For tests of correlation, a cutoff is chosen such that is rejected only if . The value of used for the and properties is controlled by the SignificanceLevel option. This value is also used in diagnostic tests of normality. By default is set to .
  • Named settings for VerifyTestAssumptions in CorrelationTest include:
  • "Normality"verify that all data is normally distributed

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Test whether the population correlation coefficient is zero:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Test whether the population correlation coefficient is 0.25:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Compare two correlation coefficients:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Report the test statistics and -values in a table:

In[4]:=
Click for copyable input
Out[4]=
Introduced in 2012
(9.0)