Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

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

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

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

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • 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
  • 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
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • 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
      • 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
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
VarianceTest
  • See Also
    • HypothesisTestData
    • LocationTest
    • LocationEquivalenceTest
    • VarianceEquivalenceTest
    • DistributionFitTest
    • IndependenceTest
    • LogRankTest
    • FisherRatioTest
    • LeveneTest
    • BrownForsytheTest
    • ConoverTest
    • SiegelTukeyTest
  • Related Guides
    • Hypothesis Tests
    • Random Variables
    • Statistical Data Analysis
    • See Also
      • HypothesisTestData
      • LocationTest
      • LocationEquivalenceTest
      • VarianceEquivalenceTest
      • DistributionFitTest
      • IndependenceTest
      • LogRankTest
      • FisherRatioTest
      • LeveneTest
      • BrownForsytheTest
      • ConoverTest
      • SiegelTukeyTest
    • Related Guides
      • Hypothesis Tests
      • Random Variables
      • Statistical Data Analysis

VarianceTest[data]

tests whether the variance of the data is one.

VarianceTest[{data1,data2}]

tests whether the variances of data1 and data2 are equal.

VarianceTest[dspec,σ02]

tests a dispersion measure against σ02.

VarianceTest[dspec,σ02,"property"]

returns the value of "property".

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Testing  
Reporting  
Options  
AlternativeHypothesis  
SignificanceLevel  
VerifyTestAssumptions  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • HypothesisTestData
    • LocationTest
    • LocationEquivalenceTest
    • VarianceEquivalenceTest
    • DistributionFitTest
    • IndependenceTest
    • LogRankTest
    • FisherRatioTest
    • LeveneTest
    • BrownForsytheTest
    • ConoverTest
    • SiegelTukeyTest
  • Related Guides
    • Hypothesis Tests
    • Random Variables
    • Statistical Data Analysis
    • See Also
      • HypothesisTestData
      • LocationTest
      • LocationEquivalenceTest
      • VarianceEquivalenceTest
      • DistributionFitTest
      • IndependenceTest
      • LogRankTest
      • FisherRatioTest
      • LeveneTest
      • BrownForsytheTest
      • ConoverTest
      • SiegelTukeyTest
    • Related Guides
      • Hypothesis Tests
      • Random Variables
      • Statistical Data Analysis

VarianceTest

VarianceTest[data]

tests whether the variance of the data is one.

VarianceTest[{data1,data2}]

tests whether the variances of data1 and data2 are equal.

VarianceTest[dspec,σ02]

tests a dispersion measure against σ02.

VarianceTest[dspec,σ02,"property"]

returns the value of "property".

Details and Options

  • VarianceTest tests the null hypothesis against the alternative hypothesis :
  • data
    {data1,data2}
  • where σi2 is the population variance for datai.
  • By default, a probability value or -value is returned.
  • A small -value suggests that it is unlikely that is true.
  • The data in dspec must be univariate {x1,x2,…}.
  • The argument can be any positive real number.
  • VarianceTest[dspec,] will choose the most powerful test that applies to dspec.
  • VarianceTest[dspec,,All] will choose all tests that apply to dspec.
  • VarianceTest[dspec,,"test"] reports the -value according to "test".
  • Most tests require normally distributed data. If a test is less sensitive to a normality assumption, it is called robust. Some tests assume that data is symmetric around its medians.
  • The following tests can be used:
  • "BrownForsythe"robustrobust Levene test
    "Conover"symmetrybased on squared ranks of data
    "FisherRatio"normalitybased on
    "Levene"robust,symmetrycompare individual and group variances
    "SiegelTukey"symmetrybased on ranks of pooled data
  • VarianceTest[data,,"HypothesisTestData"] returns a HypothesisTestData object htd that can be used to extract additional test results and properties using the form htd["property"].
  • VarianceTest[data,,"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 given:
  • AlternativeHypothesis "Unequal"the inequality for the alternative hypothesis
    SignificanceLevel 0.05cutoff for diagnostics and reporting
    VerifyTestAssumptions Automaticset which diagnostic tests to run
  • For tests of variance, 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 assumptions, including tests for normality and symmetry. By default, is set to 0.05.
  • Named settings for VerifyTestAssumptions in VarianceTest include:
  • "Normality"verify that all data is normally distributed
    "Symmetry"verify symmetry about a common median

Examples

open all close all

Basic Examples  (3)

Test variances from two populations for equality:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 100}];
Wolfram Language code: VarianceTest[data]

Create a HypothesisTestData object for further property extraction:

Wolfram Language code: ℋ = VarianceTest[data, Automatic, "HypothesisTestData"]

The full test table:

Wolfram Language code: ℋ["TestDataTable", All]

Compare the variance of a population to a particular value:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[1, 2], 10^3];
Wolfram Language code: VarianceTest[data, 4, "TestDataTable"]
Wolfram Language code: Variance[data]

Test the ratio of the variances of two populations against a particular value:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[0, 1], 100]; data2 = RandomVariate[NormalDistribution[0, 2.5], 250];
Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, "TestDataTable"]
Wolfram Language code: Variance[data1] / Variance[data2]

Perform the test with alternative hypothesis :

Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, AlternativeHypothesis -> "Less"]

Scope  (15)

Testing  (11)

Test whether the variance of a population is one:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[], 500]; data2 = RandomVariate[NormalDistribution[1, 1 / 3], 500];

The -values are typically large under :

Wolfram Language code: VarianceTest[data1]

The -values are typically small when is false:

Wolfram Language code: VarianceTest[data2]

Compare the variance of a population to a particular value:

Wolfram Language code: SeedRandom[2];data1 = RandomVariate[NormalDistribution[0, 2], 10^4]; data2 = RandomVariate[NormalDistribution[0, 2.1], 10^4];
Wolfram Language code: VarianceTest[data1, 2^2]
Wolfram Language code: VarianceTest[data2, 2^2]

Compare the variance of a quantity data to a particular value:

Wolfram Language code: SeedRandom["K"]; tempData = RandomVariate[NormalDistribution[Quantity[273, "Kelvins"], Quantity[5, "Kelvins"]], 26]
Wolfram Language code: VarianceTest[tempData, (Quantity[4.8, "Kelvins"])^2]

Compare the variances of two populations:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[], 500]; data2 = RandomVariate[StudentTDistribution[5], 500]; data3 = RandomVariate[NormalDistribution[], 350];

The -values are typically large when the variances are equal:

Wolfram Language code: VarianceTest[{data1, data3}]

The -values are typically small when the variances are not equal:

Wolfram Language code: VarianceTest[{data1, data2}]

Test whether the ratio of the variances of two populations is a particular value:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[0, 2], 500]; data2 = RandomVariate[NormalDistribution[0, 1], 500];
Wolfram Language code: Subscript[σ, 0] = 4;

The following forms are equivalent:

Wolfram Language code: VarianceTest[{data2, data1}, 1 / Subscript[σ, 0]]
Wolfram Language code: VarianceTest[{data1, data2}, Subscript[σ, 0]]

The order of the datasets should be considered when determining :

Wolfram Language code: VarianceTest[{data2, data1}, Subscript[σ, 0]]

Using Automatic applies the generally most powerful appropriate test:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 10^4}];
Wolfram Language code: VarianceTest[data, 1, Automatic]

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

Wolfram Language code: VarianceTest[data, 1, "AutomaticTest"]

Perform a particular test for equal variance:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 10^3}];
Wolfram Language code: VarianceTest[data, 1, "BrownForsythe"]

Any number of tests can be performed simultaneously:

Wolfram Language code: VarianceTest[data, 1, {"PValue", {"Levene", "BrownForsythe"}}]

Perform all tests appropriate to the data simultaneously:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 250}];
Wolfram Language code: VarianceTest[data, 1, All]

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

Wolfram Language code: VarianceTest[data, 1, "AllTests"]

Create a HypothesisTestData object for repeated property extraction:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 10^4}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];

The properties available for extraction:

Wolfram Language code: ℋ["Properties"]

Extract some properties from a HypothesisTestData object:

Wolfram Language code: SeedRandom[2];data = RandomVariate[NormalDistribution[], {2, 10^4}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];

The -value and test statistic from a Levene test:

Wolfram Language code: ℋ["PValue", "Levene"]
Wolfram Language code: ℋ["TestStatistic", "Levene"]

Extract any number of properties simultaneously:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 100}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];

The -value and test statistic from the Brown–Forsythe test:

Wolfram Language code: ℋ[{{"PValue", "BrownForsythe"}, {"TestStatistic", "BrownForsythe"}}]

Reporting  (4)

Tabulate the results from a selection of tests:

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[], {2, 10^3}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];
Wolfram Language code: ℋ["TestDataTable"]

A full table of all appropriate test results:

Wolfram Language code: ℋ["TestDataTable", All]

A table of selected test results:

Wolfram Language code: ℋ["TestDataTable", {"Conover", "BrownForsythe"}]

Retrieve the entries from a test table for customized reporting:

Wolfram Language code: data = BlockRandom[SeedRandom[1];RandomVariate[NormalDistribution[], {2, 10^3}]];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];
Wolfram Language code: res = ℋ["TestData", All];
Wolfram Language code: ℋ["AllTests"]

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

Wolfram Language code: Show[BarChart[res[[All, 2]], ChartLabels -> Placed[ℋ["AllTests"], Center], BarOrigin -> Left], Graphics[{Dashed, InfiniteLine[{{.05, 0}, {.05, 1}}]}]]

Tabulate -values for a test or group of tests:

Wolfram Language code: SeedRandom[2];data = RandomVariate[NormalDistribution[], {2, 10^4}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];
Wolfram Language code: ℋ["PValueTable", "Levene"]

The -value from the table:

Wolfram Language code: ℋ["PValue", "Levene"]

A table of -values from all appropriate tests:

Wolfram Language code: ℋ["PValueTable", All]

A table of -values from a subset of tests:

Wolfram Language code: ℋ["PValueTable", {"Levene", "Conover", "BrownForsythe"}]

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

Wolfram Language code: SeedRandom[1];data = RandomVariate[CauchyDistribution[1, 2], {2, 10^3}];
Wolfram Language code: ℋ = VarianceTest[data, 1, "HypothesisTestData"];
Wolfram Language code: ℋ["TestStatisticTable"]

The test statistic from the table:

Wolfram Language code: ℋ["TestStatistic"]

A table of test statistics from all appropriate tests:

Wolfram Language code: ℋ["TestStatisticTable", All]

Options  (10)

AlternativeHypothesis  (3)

A two-sided test is performed by default:

Wolfram Language code: SeedRandom[1]; data = RandomVariate[NormalDistribution[], 100];

Test versus :

Wolfram Language code: VarianceTest[data, 1, AlternativeHypothesis -> "Unequal"]
Wolfram Language code: VarianceTest[data, 1, AlternativeHypothesis -> Automatic]

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

Wolfram Language code: SeedRandom[1];data = RandomVariate[NormalDistribution[0, 1.25], 100];

Test versus :

Wolfram Language code: VarianceTest[data, Automatic, AlternativeHypothesis -> "Unequal"]

Test versus :

Wolfram Language code: VarianceTest[data, Automatic, AlternativeHypothesis -> "Less"]

Test versus :

Wolfram Language code: VarianceTest[data, Automatic, AlternativeHypothesis -> "Greater"]

Perform tests with one-sided alternatives when a null value is given:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[0, .9], 100]; data2 = RandomVariate[NormalDistribution[0, 1], 100];
Wolfram Language code: Variance[data1] / Variance[data2]

Test versus :

Wolfram Language code: VarianceTest[{data1, data2}, 1, AlternativeHypothesis -> "Less"]

Test versus :

Wolfram Language code: VarianceTest[{data1, data2}, 1.5, AlternativeHypothesis -> "Less"]

SignificanceLevel  (3)

Set the significance level for diagnostic tests:

Wolfram Language code: SeedRandom[1];data = BlockRandom[SeedRandom[5];RandomVariate[StudentTDistribution[3], 50]];
Wolfram Language code: VarianceTest[data, 1, "FisherRatio", SignificanceLevel -> .005]

By default, 0.05 is used:

Wolfram Language code: VarianceTest[data, 1, "FisherRatio", SignificanceLevel -> Automatic]

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

Wolfram Language code: data = BlockRandom[SeedRandom[1];RandomVariate[StudentTDistribution[3], {2, 50}]];
Wolfram Language code: VarianceTest[data, 1, "AutomaticTest", SignificanceLevel -> .0001]

A rank-based test would have been chosen by default:

Wolfram Language code: VarianceTest[data, 1, "AutomaticTest", SignificanceLevel -> Automatic]

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

Wolfram Language code: data = BlockRandom[SeedRandom[1];RandomVariate[NormalDistribution[0, 1], 100]];
Wolfram Language code: ℋ1 = VarianceTest[data, 1.5, "HypothesisTestData", SignificanceLevel -> .05];
Wolfram Language code: ℋ2 = VarianceTest[data, 1.5, "HypothesisTestData", SignificanceLevel -> .01];
Wolfram Language code: ℋ1["TestConclusion"]//TraditionalForm
Wolfram Language code: ℋ2["TestConclusion"]//TraditionalForm
Wolfram Language code: ℋ1["ShortTestConclusion"]
Wolfram Language code: ℋ2["ShortTestConclusion"]

VerifyTestAssumptions  (4)

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

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[StudentTDistribution[3], 1000]; data2 = RandomVariate[NormalDistribution[0, Sqrt[3]], 1000];

Verify all assumptions:

Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, "Levene", VerifyTestAssumptions -> All]

Check no assumptions:

Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, "Levene", VerifyTestAssumptions -> None]

Diagnostics can be controlled independently:

Wolfram Language code: SeedRandom[2];data1 = RandomVariate[StudentTDistribution[3], 1000]; data2 = RandomVariate[NormalDistribution[0, Sqrt[3]], 1000];

Assume normality but check for symmetry:

Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, "Levene", VerifyTestAssumptions -> "Symmetry"]

Only check for normality:

Wolfram Language code: VarianceTest[{data1, data2}, 1 / 4, "Levene", VerifyTestAssumptions -> "Normality"]

Test assumption values can be explicitly set:

Wolfram Language code: data = RandomVariate[CauchyDistribution[0, 1], 100];
Wolfram Language code: VarianceTest[data, 1, "TestDataTable"]
Wolfram Language code: VarianceTest[data, 1, "TestDataTable", VerifyTestAssumptions -> "Normality" -> True]

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

Wolfram Language code: data = RandomVariate[NormalDistribution[], {1000, 100}];
Wolfram Language code: AbsoluteTiming[T = Quiet@VarianceTest[#, Automatic, {"TestStatistic", "FisherRatio"}]& /@ data;]

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

Wolfram Language code: AbsoluteTiming[T2 = Quiet@VarianceTest[#, Automatic, {"TestStatistic", "FisherRatio"}, VerifyTestAssumptions -> None]& /@ data;]

The results are identical:

Wolfram Language code: SmoothHistogram[{T, T2}]

Applications  (2)

Test whether the variances of some populations are equivalent:

Wolfram Language code: SeedRandom[1];data1 = RandomVariate[NormalDistribution[0, 1], 100]; data2 = RandomVariate[NormalDistribution[0, 1], 100]; data3 = RandomVariate[NormalDistribution[0, 3], 100];
Wolfram Language code: BoxWhiskerChart[{data1, data2, data3}, "Notched", ChartStyle -> "SolarColors"]

The first two populations have similar variances:

Wolfram Language code: VarianceTest[{data1, data2}, Automatic, "TestDataTable"]

The third population differs in variance from the first:

Wolfram Language code: VarianceTest[{data1, data3}, Automatic, "TestDataTable"]

An object with a length of 2.15 cm was measured with the same ruler by 25 grade-school students in two different classes:

Wolfram Language code: group1 = {2.28, 2.13, 2.21, 2., 2.06, 2.09, 2.12, 2.27, 2.17, 2.09, 2.02, 2.28, 2.28, 2.03, 2.11, 2.05, 2.06, 2.28, 2.1, 2.35, 2.07, 2.22, 2.19, 2.33, 2.02};
Wolfram Language code: group2 = {2.03, 2.12, 1.92, 1.96, 2.05, 2.05, 2.02, 2.12, 2.02, 1.95, 2., 2.03, 1.93, 1.96, 2.08, 1.92, 2.12, 2.01, 1.84, 2.06, 2., 1.95, 1.90, 2., 1.94};
Wolfram Language code: {Variance[group1], Variance[group2]}

The second group is superior in their precision:

Wolfram Language code: VarianceTest[{group1, group2}, 1, "TestDataTable"]

Compare the accuracy of the groups using squared error:

Wolfram Language code: SqrErr1 = (group1 - 2.15)^2;SqrErr2 = (group2 - 2.15)^2;
Wolfram Language code: {Mean[SqrErr1], Mean[SqrErr2]}

The first group is significantly more accurate:

Wolfram Language code: LocationTest[{SqrErr1, SqrErr2}, 0, "TestDataTable"]

Properties & Relations  (7)

The -value suggests the expected proportion of false positives (Type I errors):

Wolfram Language code: data = RandomVariate[NormalDistribution[], {1000, 10}];
Wolfram Language code: pvals = Table[VarianceTest[i, 1, "FisherRatio", VerifyTestAssumptions -> None], {i, data}];

Setting the size of a test to 0.05 results in an erroneous rejection of about 5% of the time:

Wolfram Language code: Probability[x ≤ 0.05, xpvals]//N

The power of each test is the probability of rejecting when it is false:

Wolfram Language code: n = 100;
Wolfram Language code: data1 = RandomVariate[NormalDistribution[0, .75], {1000, n}]; data2 = RandomVariate[NormalDistribution[0, 1], {1000, n}];
Wolfram Language code: tests = VarianceTest[{data1[[1]], data2[[1]]}, 1, "AllTests"]
Wolfram Language code: pvs = MapThread[VarianceTest[{#1, #2}, 1, tests, VerifyTestAssumptions -> None]&, {data1, data2}];
Wolfram Language code: α = {.001, .005, .01, .025, .05, .1};

The power of the tests at six different levels. The Siegel–Tukey has the lowest power:

Wolfram Language code: Grid[Join[{Join[{""}, α]}, Table[Join[{tests[[i]]}, (Probability[x ≤ #1, xpvs[[All, i]]]&) /@ α], {i, Length[tests]}]], Alignment -> Left, Background -> {None, {StandardGray, {StandardBlue, StandardPink}}}, Dividers -> {{False, True}, {False, True}}]//N

The power of the tests is proportional to the sample size:

Wolfram Language code: n = 10;
Wolfram Language code: data1 = RandomVariate[NormalDistribution[0, .75], {1000, n}]; data2 = RandomVariate[NormalDistribution[0, 1], {1000, n}];
Wolfram Language code: tests = VarianceTest[{data1[[1]], data2[[1]]}, 1, "AllTests"]
Wolfram Language code: pvs = MapThread[VarianceTest[{#1, #2}, 1, tests, VerifyTestAssumptions -> None]&, {data1, data2}];
Wolfram Language code: α = {.001, .005, .01, .025, .05, .1};

The power of the tests is lower than in the previous example:

Wolfram Language code: Grid[Join[{Join[{""}, α]}, Table[Join[{tests[[i]]}, (Probability[x ≤ #1, xpvs[[All, i]]]&) /@ α], {i, Length[tests]}]], Alignment -> Left, Background -> {None, {StandardGray, {StandardPurple, StandardBlue}}}, Dividers -> {{False, True}, {False, True}}]//N

A two-sided -value is twice the smaller of the two one-sided -values:

Wolfram Language code: data1 = RandomVariate[NormalDistribution[0, 1], 100]; data2 = RandomVariate[NormalDistribution[0, .5], 100];
Wolfram Language code: twoSided = VarianceTest[{data1, data2}, 1, All, AlternativeHypothesis -> "Unequal"];
Wolfram Language code: minOneSided = Min /@ Transpose[{VarianceTest[{data1, data2}, 1, All, AlternativeHypothesis -> "Less"], VarianceTest[{data1, data2}, 1, All, AlternativeHypothesis -> "Greater"]}];
Wolfram Language code: twoSided - 2 minOneSided

The Brown–Forsythe and Levene tests are equivalent to the Fisher ratio test for a single sample:

Wolfram Language code: data = RandomVariate[NormalDistribution[], 100];
Wolfram Language code: VarianceTest[data, Automatic, {"TestDataTable", {"FisherRatio", "BrownForsythe", "Levene"}}]

The variance test works with the values only when the input is a TimeSeries:

Wolfram Language code: ts = TemporalData[TimeSeries, {{{1.224578634529677, 0.47929635789978015, 0.6572781300178168, 0.21496048742669355, 0.7299608014554928, -0.2495111111278263, -1.3286551762002712, 0.552725018274874, 0.19272112205837066, 1.1809144012420882, -1.1671 ... 40938613662046, 1.052394590214582, 0.9345044123980388, 0.38537803109557855, -0.48660931166089394, -0.71203560340161}}, {{0, 100, 1}}, 1, {"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, ResamplingMethod -> None}}, False, 10.1];
Wolfram Language code: VarianceTest[ts, Automatic, {"TestDataTable", All}]
Wolfram Language code: VarianceTest[ts["Values"], Automatic, {"TestDataTable", All}]
Wolfram Language code: %% == %

The variance test works with all the values together when the input is a TemporalData:

Wolfram Language code: td = TemporalData[Automatic, {{{-0.25275046867718637, -0.7175779198306353, -1.9370139837317764, 0.006665621735740701, -0.3730807122324292, 0.6740106823161018, 0.8562214990564344, 0.955785083955732, 1.7020898014886303, 1.8523009430646802, 0.244 ... 3951759101545, -1.1611722313627828, 1.1602446901533021, 1.1052173095128992, 1.1089143920161917, -0.13837156328402}}, {{0, 100, 1}}, 2, {"Continuous", 2}, {"Discrete", 1}, 1, {ValueDimensions -> 1, ResamplingMethod -> None}}, False, 10.1];
Wolfram Language code: VarianceTest[td]

Test all the values only:

Wolfram Language code: data = td["ValueList"]//Flatten; VarianceTest[data]

Test whether the variances of the two paths are equal:

Wolfram Language code: {data1, data2} = td["ValueList"];
Wolfram Language code: VarianceTest[{data1, data2}]

Possible Issues  (2)

The Conover and Siegel–Tukey tests are not defined for a single sample:

Wolfram Language code: data = RandomVariate[NormalDistribution[], 100];
Wolfram Language code: VarianceTest[data, Automatic, {"TestDataTable", {"Conover", "SiegelTukey"}}]

Some tests assume the data is normally distributed:

Wolfram Language code: data = RandomVariate[LaplaceDistribution[1, 2], {2, 100}];
Wolfram Language code: VarianceTest[data, Automatic, {"TestDataTable", {"BrownForsythe", "FisherRatio", "Levene"}}]

Conover's test and the Siegel–Tukey test do not assume normality:

Wolfram Language code: VarianceTest[data, Automatic, {"TestDataTable", {"Conover", "SiegelTukey"}}]

Neat Examples  (1)

Compute the statistic when the null hypothesis is true:

Wolfram Language code: data = RandomVariate[NormalDistribution[], {250, 100}];
Wolfram Language code: T1 = VarianceTest[#, 1, "TestStatistic", VerifyTestAssumptions -> None]& /@ data;

The test statistic given a particular alternative:

Wolfram Language code: T2 = VarianceTest[#, 2, "TestStatistic", VerifyTestAssumptions -> None]& /@ data;

Compare the distributions of the test statistics:

Wolfram Language code: SmoothHistogram[{T1, T2}, Filling -> Axis, PlotLegends -> {"SubscriptBox[H, 0] is True", "SubscriptBox[H, 0] is False"}]

See Also

HypothesisTestData  LocationTest  LocationEquivalenceTest  VarianceEquivalenceTest  DistributionFitTest  IndependenceTest  LogRankTest  FisherRatioTest  LeveneTest  BrownForsytheTest  ConoverTest  SiegelTukeyTest

Related Guides

    ▪
  • Hypothesis Tests
  • ▪
  • Random Variables
  • ▪
  • Statistical Data Analysis

History

Introduced in 2010 (8.0)

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2026_variancetest, author="Wolfram Research", title="{VarianceTest}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/VarianceTest.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_variancetest, organization={Wolfram Research}, title={VarianceTest}, year={2010}, url={https://reference.wolfram.com/language/ref/VarianceTest.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

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

  • Wolfram Engine
  • Wolfram Player

  • 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
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English