Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
IndependenceTest
  • See Also
    • HypothesisTestData
    • DistributionFitTest
    • LocationTest
    • VarianceTest
    • BlomqvistBeta
    • CorrelationTest
    • GoodmanKruskalGamma
    • HoeffdingD
    • KendallTau
    • Correlation
    • PillaiTrace
    • SpearmanRho
    • WilksW
  • Related Guides
    • Hypothesis Tests
    • Probability & Statistics with Quantities
    • See Also
      • HypothesisTestData
      • DistributionFitTest
      • LocationTest
      • VarianceTest
      • BlomqvistBeta
      • CorrelationTest
      • GoodmanKruskalGamma
      • HoeffdingD
      • KendallTau
      • Correlation
      • PillaiTrace
      • SpearmanRho
      • WilksW
    • Related Guides
      • Hypothesis Tests
      • Probability & Statistics with Quantities

IndependenceTest[v1,v2]

tests whether the vectors v1 and v2 are independent.

IndependenceTest[m1,m2]

tests whether the matrices m1 and m2 are independent.

IndependenceTest[…,"property"]

returns the value of "property".

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Testing  
Reporting  
Options  
AlternativeHypothesis  
MaxIterations  
Method  
SignificanceLevel  
VerifyTestAssumptions  
Properties & Relations  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • HypothesisTestData
    • DistributionFitTest
    • LocationTest
    • VarianceTest
    • BlomqvistBeta
    • CorrelationTest
    • GoodmanKruskalGamma
    • HoeffdingD
    • KendallTau
    • Correlation
    • PillaiTrace
    • SpearmanRho
    • WilksW
  • Related Guides
    • Hypothesis Tests
    • Probability & Statistics with Quantities
    • See Also
      • HypothesisTestData
      • DistributionFitTest
      • LocationTest
      • VarianceTest
      • BlomqvistBeta
      • CorrelationTest
      • GoodmanKruskalGamma
      • HoeffdingD
      • KendallTau
      • Correlation
      • PillaiTrace
      • SpearmanRho
      • WilksW
    • Related Guides
      • Hypothesis Tests
      • Probability & Statistics with Quantities

IndependenceTest

IndependenceTest[v1,v2]

tests whether the vectors v1 and v2 are independent.

IndependenceTest[m1,m2]

tests whether the matrices m1 and m2 are independent.

IndependenceTest[…,"property"]

returns the value of "property".

Details and Options

  • IndependenceTest performs a hypothesis test on v1 and v2 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 v1 and v2 can be any real-valued vectors or matrices of equal length.
  • IndependenceTest[v1,v2] will choose the most powerful test that applies to v1 and v2.
  • IndependenceTest[v1,v2,All] will choose all tests that apply to v1 and v2.
  • IndependenceTest[v1,v2,"test"] reports the -value according to "test".
  • Some of the available tests assume normality for the vi. Some tests are restricted to vectors. Most tests are restricted to tests of monotonic or linear independence.
  • The following tests can be used:
  • "BlomqvistBeta"monotonicbased on Blomqvist's
    "GoodmanKruskalGamma"monotonic, vectorbased on the -coefficient
    "HoeffdingD"vectorbased on Hoeffding's
    "KendallTau"monotonicbased on Kendall's
    "PearsonCorrelation"linear, normality, vectorbased on Pearson product-moment
    "PillaiTrace"normality, linearbased on Pillai's trace
    "SpearmanRank"monotonicbased on Spearman's
    "WilksW"normality, linearbased on Wilks'
  • IndependenceTest[v1,v2,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • IndependenceTest[v1,v2,"property"] can be used to directly give the value of "property".
  • Properties related to the reporting of test results include:
  • "AllTests"list of all applicable tests
    "AutomaticTest"test chosen if Automatic is used
    "DegreesOfFreedom"the degrees of freedom used in a test
    "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
    MaxIterations Automaticmax iterations for multivariate nonparametric tests
    Method Automaticthe method to use for computing -values
    SignificanceLevel 0.05cutoff for diagnostics and reporting
    VerifyTestAssumptions Automaticwhat assumptions to verify
  • For tests of independence, a cutoff is chosen such that is rejected only if . The value of used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the SignificanceLevel option. This value is also used in diagnostic tests of normality. By default, is set to 0.05.
  • Named settings for VerifyTestAssumptions in IndependenceTest include:
  • "Normality"verify that all data is normally distributed

Examples

open all close all

Basic Examples  (2)

Test whether two vectors are independent:

Test whether two matrices are independent:

At the 0.05 level, there is insufficient evidence to reject independence:

Scope  (12)

Testing  (8)

Test whether two vectors are independent:

The -values are typically large when the vectors are independent:

The -values are typically small when there are dependencies:

Test whether two matrices are independent:

The -values are typically small for dependent matrices:

The -values are typically large when matrices are independent:

Using Automatic applies the most powerful appropriate test for linear independence:

The property "AutomaticTest" can be used to determine which test was chosen:

Perform a particular test for independence:

Any number of tests can be performed simultaneously:

Perform all tests appropriate to the data simultaneously:

Use the property "AllTests" to identify which tests were used:

Create a HypothesisTestData object for repeated property extraction:

The properties available for extraction:

Extract some properties from the HypothesisTestData object:

The -value and test statistic from the "PearsonCorrelation" test:

Extract any number of properties simultaneously:

The -value and test statistic from a Spearman rank test:

Reporting  (4)

Tabulate the results from a selection of tests:

A full table of all appropriate test results:

A table of selected test results:

Retrieve the entries from a test table for customized reporting:

The -values are above 0.05, so there is not enough evidence to reject at that level:

Tabulate -values for a test or group of tests:

The -value from the table:

A table of -values from all appropriate tests:

A table of -values from a subset of tests:

Report the test statistic from a test or group of tests:

The test statistic from the table:

A table of test statistics from all appropriate tests:

Options  (15)

AlternativeHypothesis  (3)

A two-sided test is performed by default:

Perform a two-sided test or a one-sided alternative:

A two-sided test:

The two one-sided alternatives:

Some tests are inherently two-sided:

This is due to the shape of the null distribution:

MaxIterations  (1)

Set the maximum number of iterations to use for multivariate nonparametric tests:

Setting the value too low may result in failed convergence but produce faster timings:

Method  (4)

By default, -values are computed using asymptotic test statistic distributions:

The -value can be obtained using permutation methods:

Set the number of permutations to use:

By default, random permutations are used:

Set the seed used for generating random permutations:

SignificanceLevel  (3)

Set the significance level for diagnostic tests:

By default, 0.05 is used. The message shows 0.025 because two tests were performed:

Setting the significance level may alter which test is automatically chosen:

A nonparametric test would have been chosen by default:

The significance level is also used for "TestConclusion" and "ShortTestConclusion":

VerifyTestAssumptions  (4)

By default, normality is tested when appropriate:

Diagnostics can be controlled as a group using All or None:

Verify all assumptions:

Check no assumptions:

Diagnostics can be controlled independently:

Check for normality:

Explicitly set the diagnostic result:

It is often useful to bypass diagnostic tests for simulation purposes:

The assumptions of the test hold by design, so a great deal of time can be saved:

The results are identical:

Properties & Relations  (4)

The test chosen depends on normality assumptions and the dimensionality of the data:

Comparison of normally distributed vectors:

The second vector is not from a normal distribution:

Matrix comparison of normally distributed data:

Matrix comparison of data that is not normally distributed:

To test particular values of correlation or rank correlation, use CorrelationTest:

HoeffdingDTest should be used if nonlinear dependency is expected:

The data is clearly dependent:

IndependenceTest does not detect this by default:

Measures of monotone dependence are selected by default:

HoeffdingD is sensitive to many types of dependence:

IndependenceTest works with the values only when the input is a TimeSeries:

Neat Examples  (1)

The distributions of some test statistics:

See Also

HypothesisTestData  DistributionFitTest  LocationTest  VarianceTest  BlomqvistBeta  CorrelationTest  GoodmanKruskalGamma  HoeffdingD  KendallTau  Correlation  PillaiTrace  SpearmanRho  WilksW

Related Guides

    ▪
  • Hypothesis Tests
  • ▪
  • Probability & Statistics with Quantities

History

Introduced in 2012 (9.0)

Wolfram Research (2012), IndependenceTest, Wolfram Language function, https://reference.wolfram.com/language/ref/IndependenceTest.html.

Text

Wolfram Research (2012), IndependenceTest, Wolfram Language function, https://reference.wolfram.com/language/ref/IndependenceTest.html.

CMS

Wolfram Language. 2012. "IndependenceTest." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/IndependenceTest.html.

APA

Wolfram Language. (2012). IndependenceTest. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/IndependenceTest.html

BibTeX

@misc{reference.wolfram_2025_independencetest, author="Wolfram Research", title="{IndependenceTest}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/IndependenceTest.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_independencetest, organization={Wolfram Research}, title={IndependenceTest}, year={2012}, url={https://reference.wolfram.com/language/ref/IndependenceTest.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English