({{, (RefLink[ConoverTest, paclet:ref/ConoverTest])[{(Subscript[data, 1]),(Subscript[data, 2]),…}]
tests whether the variances of (Subscript[data, 1]), (Subscript[data, 2]), … are equal.}, {, (RefLink[ConoverTest, paclet:ref/ConoverTest])[dspec,(Subscript[σ, 0]^2)]
tests a dispersion measure against (Subscript[σ, 0]^2).}, {, (RefLink[ConoverTest, paclet:ref/ConoverTest])[dspec,(Subscript[σ, 0]^2),"property"]
returns the value of "property".}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ConoverTest, paclet:ref/ConoverTest]) tests the null hypothesis (Subscript[H, 0]) against the alternative hypothesis (Subscript[H, a]):

where ((Subscript[σ, i])^2) is the population variance for (Subscript[data, i]).

By default, a probability value or p-value is returned.

A small p-value suggests that it is unlikely that (Subscript[H, 0]) is true.

The data in dspec must be univariate {(Subscript[x, 1]),(Subscript[x, 2]),…}.

The argument (Subscript[σ, 0]^2) can be any positive real number. The default value of (Subscript[σ, 0]^2) is 1 if not specified, and ignored if the number of groups in dspec is more than 2.

(RefLink[ConoverTest, paclet:ref/ConoverTest]) assumes the data is symmetric about a common median.

(RefLink[ConoverTest, paclet:ref/ConoverTest])[data,(Subscript[σ, 0]^2),"HypothesisTestData"] returns a (RefLink[HypothesisTestData, paclet:ref/HypothesisTestData]) object htd that can be used to extract additional test results and properties using the form htd["property"].

(RefLink[ConoverTest, paclet:ref/ConoverTest])[data,(Subscript[σ, 0]^2),"property"] can be used to directly give the value of "property".

Properties related to the reporting of test results include:

The test statistic is based on the squared ranks of the absolute deviations from the sample medians.

For the k-sample case, {(Subscript[data, 1]),(Subscript[data, 2]),…,(Subscript[data, k])} with (Subscript[data, i])={(Subscript[x, i,1]),(Subscript[x, i,2]),…,(Subscript[x, i,(Subscript[n, i])])}, the rank (Subscript[r, i,j]) of the value (Subscript[x, i,j]) is the rank of (Subscript[z, i,j]) among all the elements (Subscript[{(Subscript[z, i,j])}, 1≤i≤k,1≤j≤(Subscript[n, i])]), where (Subscript[z, i,j])=Abs[(Subscript[x, i,j])-Median[(Subscript[data, i])]]. The test statistic is given by ((Subscript[S, 1])/(Subscript[n, 1])-(Subscript[S, 2])/(Subscript[n, 2]))/(Sqrt[(D^2) (1/(Subscript[n, 1])+1/(Subscript[n, 2]))]) for k equal to 2 and (∑_(i=1)^k)((Subscript[S, i]^2)/(Subscript[n, i])-(S^2) (Subscript[n, i]))/(D^2) for k greater than 2, where (Subscript[S, i])=(∑_(j=1)^(Subscript[n, i]))((Subscript[r, i,j])^2), S=((∑_(i=1)^k)(Subscript[S, i]))/((∑_(i=1)^k)(Subscript[n, i])), and (D^2)=((∑_(i=1)^k)(∑_(j=1)^(Subscript[n, i]))(((Subscript[r, i,j])^4)-(S^2)))/(((∑_(i=1)^k)(Subscript[n, i]))-1).

Under (Subscript[H, 0]), the test statistic of (RefLink[ConoverTest, paclet:ref/ConoverTest]) is assumed to follow (RefLink[NormalDistribution, paclet:ref/NormalDistribution])[0,1] for k equal to 2 and (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution])[k-1] for k greater than 2.

(RefLink[ConoverTest, paclet:ref/ConoverTest]) is sometimes called the squared ranks test and is an alternative to the (RefLink[FisherRatioTest, paclet:ref/FisherRatioTest]) when the (Subscript[data, i]) is not normally distributed.

The following options can be used:

For the (RefLink[ConoverTest, paclet:ref/ConoverTest]), a cutoff α is chosen such that (Subscript[H, 0]) is rejected only if p<α. The value of α used for the "TestConclusion" and "ShortTestConclusion" properties is controlled by the (RefLink[SignificanceLevel, paclet:ref/SignificanceLevel]) option. This value α is also used in diagnostic tests of assumptions, including tests for symmetry. By default, α is set to 0.05.

Named settings for (RefLink[VerifyTestAssumptions, paclet:ref/VerifyTestAssumptions]) in (RefLink[ConoverTest, paclet:ref/ConoverTest]) include:

OpenersPrimaryExamplesSection(Spacer1)Examples  (29)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Test variances from two populations for equality:

data=RandomVariate[LaplaceDistribution[1,2],{2,100}];

ConoverTest[data]

Create a (RefLink[HypothesisTestData, paclet:ref/HypothesisTestData]) object for further property extraction:

ℋ=ConoverTest[data,Automatic,"HypothesisTestData"]

Properties of the test:

ℋ["Properties"]

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

data1=RandomVariate[NormalDistribution[0,1],100];
data2=RandomVariate[NormalDistribution[0,2.5],250];

ConoverTest[{data1,data2},1/4,"TestDataTable"]

Variance[data1]/Variance[data2]

Perform the test with alternative hypothesis (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)<1/4:

ConoverTest[{data1,data2},1/4,AlternativeHypothesis->"Less"]

OpenersExampleSection1(Spacer1)Scope  (8)

OpenersExampleSubsection0(Spacer1)Testing  (6)

Compare the variances of two populations:

data1=RandomVariate[NormalDistribution[0,3],500];
data2=RandomVariate[NormalDistribution[1,3],500];

The p-value is uniformly distributed in [0,1] under (Subscript[H, 0]):

ConoverTest[{data1,data2}]

The histogram of a sample of p-values of the Conover test:

sample=Table[Quiet@ConoverTest[{RandomVariate[NormalDistribution[0,3],100],RandomVariate[NormalDistribution[1,3],100]}],{5 10^3}];

Histogram[sample,Automatic, PDF]

The p-value is typically small when (Subscript[H, 0]) is false:

data3=RandomVariate[NormalDistribution[10,1],350];

ConoverTest[{data1,data3}]

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

data1=RandomVariate[NormalDistribution[0,2],500];
data2=RandomVariate[NormalDistribution[0,1],500];

(Subscript[σ, 0])=4;

The following forms are equivalent:

ConoverTest[{data1,data2},(Subscript[σ, 0])]

ConoverTest[{data2,data1},1/(Subscript[σ, 0])]

The order of the datasets should be considered when determining (Subscript[σ, 0]):

ConoverTest[{data2,data1},(Subscript[σ, 0])]

Test whether the variances of three populations are identical:

data1=RandomVariate[NormalDistribution[10,1],500];
data2=RandomVariate[NormalDistribution[0,1],200];
data3=RandomVariate[NormalDistribution[-3,1],400];

ConoverTest[{data1,data2,data3}]

Create a (RefLink[HypothesisTestData, paclet:ref/HypothesisTestData]) object for repeated property extraction:

data=RandomVariate[NormalDistribution[],{2,(10^4)}];

ℋ=ConoverTest[data,1,"HypothesisTestData"];

The properties available for extraction:

ℋ["Properties"]

Extract some properties from a (RefLink[HypothesisTestData, paclet:ref/HypothesisTestData]) object:

data=RandomVariate[NormalDistribution[],{2,(10^4)}];

ℋ=ConoverTest[data,1,"HypothesisTestData"];

The p-value and test statistic:

ℋ["PValue"]

ℋ["TestStatistic"]

Extract any number of properties simultaneously:

data=RandomVariate[NormalDistribution[],{2,100}];

ℋ=ConoverTest[data,1,"HypothesisTestData"];

The p-value and test statistic:

ℋ["PValue","TestStatistic"]

OpenersExampleSubsection1(Spacer1)Reporting  (2)

Tabulate test results:

data=RandomVariate[NormalDistribution[],{2,(10^3)}];

ℋ=ConoverTest[data,1,"HypothesisTestData"];

ℋ["TestDataTable"]

The values from the table can be extracted using "TestData":

ℋ["TestData"]

Tabulate p-values or test statistics:

data=RandomVariate[NormalDistribution[],{3,(10^4)}];

ℋ=ConoverTest[data,1,"HypothesisTestData"];

ℋ["PValueTable"]

The p-value from the table:

ℋ["PValue"]

ℋ["TestStatisticTable"]

The test statistic from the table:

ℋ["TestStatistic"]

OpenersExampleSection2(Spacer1)Options  (6)

OpenersExampleSubsection2(Spacer1)AlternativeHypothesis  (3)

By default, a two-sided test is performed:

data=RandomVariate[NormalDistribution[],{2,100}];

ConoverTest[data,1,AlternativeHypothesis->"Unequal"]

ConoverTest[data,1,AlternativeHypothesis->Automatic]

Perform a two-sided test or one of two one-sided alternatives:

data1=RandomVariate[NormalDistribution[0,1],100];
data2=RandomVariate[NormalDistribution[0,1.5],100];

Variance[data1]/Variance[data2]

Test (Subscript[H, 0]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)=1 versus (Subscript[H, a]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)≠1:

ConoverTest[{data1,data2},1,AlternativeHypothesis->"Unequal"]

Test (Subscript[H, 0]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)≥1 versus (Subscript[H, a]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)<1:

ConoverTest[{data1,data2},1,AlternativeHypothesis->"Less"]

Test (Subscript[H, 0]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)≤1 versus (Subscript[H, a]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)>1:

ConoverTest[{data1,data2},1,AlternativeHypothesis->"Greater"]

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

data1=RandomVariate[NormalDistribution[0,.9],100];
data2=RandomVariate[NormalDistribution[0,1],100];

Variance[data1]/Variance[data2]

Test (Subscript[H, 0]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)≥.75 versus (Subscript[H, a]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)<.75:

ConoverTest[{data1,data2},.75,AlternativeHypothesis->"Less"]

Test (Subscript[H, 0]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)≥1.5 versus (Subscript[H, a]): (Subscript[σ, 1]^2)/(Subscript[σ, 2]^2)<1.5:

ConoverTest[{data1,data2},1.5,AlternativeHypothesis->"Less"]

OpenersExampleSubsection3(Spacer1)SignificanceLevel  (1)

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

data=BlockRandom[SeedRandom[1];RandomVariate[NormalDistribution[0,1],{2,100}]];

ℋ1=ConoverTest[data,2,"HypothesisTestData",SignificanceLevel->.05];

ℋ2=ConoverTest[data,2,"HypothesisTestData",SignificanceLevel->.01];

ℋ1["TestConclusion"]

ℋ2["TestConclusion"]

ℋ1["ShortTestConclusion"]

ℋ2["ShortTestConclusion"]

OpenersExampleSubsection4(Spacer1)VerifyTestAssumptions  (2)

Diagnostics can be controlled as a group using (RefLink[All, paclet:ref/All]) or (RefLink[None, paclet:ref/None]):

BlockRandom[SeedRandom[4];data1=RandomVariate[ExponentialDistribution[1/Sqrt[3]],1000];
data2=RandomVariate[NormalDistribution[0,Sqrt[3]],1000]];

Verify all assumptions:

ConoverTest[{data1,data2},1/4,VerifyTestAssumptions->All]

Check no assumptions:

ConoverTest[{data1,data2},1/4,VerifyTestAssumptions->None]

Diagnostics can be controlled independently:

BlockRandom[SeedRandom[2];data1=RandomVariate[ExponentialDistribution[1/Sqrt[3]],1000];
data2=RandomVariate[NormalDistribution[0,Sqrt[3]],1000]];

Check for symmetry:

ConoverTest[{data1,data2},1/4,VerifyTestAssumptions->"Symmetry"]

Set the symmetry assumption to (RefLink[True, paclet:ref/True]):

ConoverTest[{data1,data2},1/4,VerifyTestAssumptions->"Symmetry"->True]

OpenersExampleSection3(Spacer1)Applications  (1)

Compare the variance of daily point changes in the S&P 500 for the first and second half of the 1990s:

sp90to95=FinancialData["SP500",{{1990,1},{1994,12,31}}];
sp95to00=FinancialData["SP500",{{1995,1},{1999,12,31}}];

DateListPlot[{sp90to95,sp95to00}]

The data is clearly not normally distributed:

DistributionFitTest/@{spA=Differences[sp90to95],spB=Differences[sp95to00]}

SmoothHistogram[{spA,spB},PlotRange->All]

The amount of variation for the first half of the 1990s is significantly lower than the second:

ConoverTest[{spA,spB},1,"TestDataTable"]

OpenersExampleSection4(Spacer1)Properties & Relations  (8)

Under (Subscript[H, 0]), the test statistic follows (RefLink[NormalDistribution, paclet:ref/NormalDistribution])[0,1] when the number of groups is 2:

data1=RandomVariate[NormalDistribution[-5,1],{1000,100}];
data2=RandomVariate[NormalDistribution[3,1],{1000,400}];

T=MapThread[ConoverTest[{#1,#2},Automatic,"TestStatistic",VerifyTestAssumptions->None]&,{data1,data2}];

Show[Plot[PDF[NormalDistribution[],x],{x,-4,4}],SmoothHistogram[T,PlotStyle->Orange]]

DistributionFitTest[T,NormalDistribution[]]

Under (Subscript[H, 0]), the test statistic follows (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution])[k-1] when the number of groups is k with k>2:

data1=RandomVariate[NormalDistribution[-5,1],{2000,600}];
data2=RandomVariate[NormalDistribution[3,1],{2000,500}];
data3=RandomVariate[NormalDistribution[2,1],{2000,400}];

T=MapThread[ConoverTest[{#1,#2,#3},Automatic,"TestStatistic",VerifyTestAssumptions->None]&,{data1,data2,data3}];

Show[Histogram[T,Automatic,"PDF"],Plot[PDF[ChiSquareDistribution[2],x],{x,0,8}]]

DistributionFitTest[T,ChiSquareDistribution[2]]

Unlike the (RefLink[FisherRatioTest, paclet:ref/FisherRatioTest]), the Conover test does not assume normality:

data1=RandomVariate[LaplaceDistribution[1,2],{1000,100}];
data2=RandomVariate[LaplaceDistribution[1,2],{1000,75}];

fisher=MapThread[FisherRatioTest[{#1,#2},Automatic,VerifyTestAssumptions->None]&,{data1,data2}];

conover=MapThread[ConoverTest[{#1,#2},Automatic,VerifyTestAssumptions->None]&,{data1,data2}];

The (RefLink[FisherRatioTest, paclet:ref/FisherRatioTest]) results in underestimation of p-values:

Histogram[{fisher,conover},Automatic,"PDF"]

The Conover test assumes the data is symmetric about a common median:

data1=RandomVariate[d1=NormalDistribution[0,((((25/6)))^(1/2))],{1000,50}];
data2=RandomVariate[d2=TriangularDistribution[{-10,0}],{1000,50}];

Variance[d1]==Variance[d2]

T=MapThread[ConoverTest[{#1,#2},Automatic,"TestStatistic",VerifyTestAssumptions->None]&,{data1,data2}];

Show[Plot[PDF[NormalDistribution[],x],{x,-4,4}],SmoothHistogram[T,PlotStyle->Orange]]

The distribution of the test statistic is not standard normal when the data is asymmetric:

DistributionFitTest[T,NormalDistribution[]]

The test statistic for the (RefLink[ConoverTest, paclet:ref/ConoverTest]) is rank-based:

n=1000;m=750;(Subscript[σ, 0])=2;

data1=RandomVariate[NormalDistribution[1,Sqrt[6]],n];
data2=RandomVariate[StudentTDistribution[3],m];

With no ties, (RefLink[Ordering, paclet:ref/Ordering]) can be used to compute ranks:

ranks=Ordering[Ordering[Join[Abs[data1-Median[data1]],(Sqrt[(Subscript[σ, 0])]) Abs[data2-Median[data2]]]]];

R2=(1/(n+m))(∑_(i=1)^(n+m))((ranks[[i]])^2);

R4=(∑_(i=1)^(n+m))((ranks[[i]])^4);

The test statistic:

((∑_(i=1)^n)((ranks[[i]])^2)-n R2)/(Sqrt[((m n (-(m+n) (R2^2)+R4))/((-1+m+n) (m+n)))])//N

ConoverTest[{data1,data2},(Subscript[σ, 0]),"TestStatistic"]

The (RefLink[PearsonChiSquareTest, paclet:ref/PearsonChiSquareTest]) is used to test data for symmetry about a common median:

data1=RandomVariate[NormalDistribution[10,1],100];
data2=RandomVariate[NormalDistribution[3,2],150];
data3=RandomVariate[ExponentialDistribution[10],135];

SymmTest[d1_,d2_]:=Block[{d=Sort[Flatten[{d1-Median[d1],d2-Median[d2]}]],c,symmDat},c=Ceiling[((Length[d])/2)];symmDat=Join[d[[1;;c]],-d[[1;;c]]];PearsonChiSquareTest[symmDat,d]]

SymmTest[data1,data2]

The data is found to be symmetric and no warning is issued:

ConoverTest[{data1,data2},1,"TestDataTable",VerifyTestAssumptions->"Symmetry"]

SymmTest[data2,data3]

The p-value in the warning matches that of the (RefLink[PearsonChiSquareTest, paclet:ref/PearsonChiSquareTest]):

ConoverTest[{data2,data3},1,"TestDataTable",VerifyTestAssumptions->"Symmetry"]

The Conover test ignores the time stamps when the input is a (RefLink[TimeSeries, paclet:ref/TimeSeries]):

ts1=TimeSeries[];

ts2=TimeSeries[];

ConoverTest[{ts1,ts2}]

ConoverTest[{ts1["Values"],ts2["Values"]}]

The Conover test recognizes the path structure of a (RefLink[TemporalData, paclet:ref/TemporalData]):

td=TemporalData[];

ConoverTest[td]

Use the values directly:

ConoverTest[td["ValueList"]]

OpenersExampleSection5(Spacer1)Possible Issues  (3)

The data should be symmetric about a common median:

data1=RandomVariate[NormalDistribution[],1000];
data2=RandomVariate[NormalDistribution[10,1],1000];
data3=RandomVariate[ParetoDistribution[1,2],1000];

The first two datasets are symmetric after accounting for a shift in location:

SmoothHistogram[Join[data1-Median[data1],data2-Median[data2]]]

ConoverTest[{data1,data2},VerifyTestAssumptions->"Symmetry"]

The last two datasets are not symmetric about their common median:

SmoothHistogram[Join[data2-Median[data2],data3-Median[data3]],PlotRange->All]

ConoverTest[{data2,data3},VerifyTestAssumptions->"Symmetry"]

The Conover test ignores the argument (Subscript[σ, 0]^2) when there are more than 2 groups:

data=RandomVariate[NormalDistribution[1,2],{4,100}];

Length[data]

ConoverTest[data,2,"TestDataTable"]

When there are more than 2 groups in the data, the Conover test only allows the two-sided test for the alternative hypothesis:

data=RandomVariate[NormalDistribution[1,2],{4,100}];

ConoverTest[data,1,AlternativeHypothesis->"Unequal"]

ConoverTest[data,1,AlternativeHypothesis->"Greater"]

ConoverTest[data,1,AlternativeHypothesis->"Less"]

OpenersExampleSection6(Spacer1)Neat Examples  (1)

Compute the statistic when the null hypothesis (Subscript[H, 0]) is true:

data1=RandomVariate[NormalDistribution[],{250,100}];
data2=RandomVariate[NormalDistribution[],{250,100}];

T1=MapThread[ConoverTest[{#1,#2},1,"TestStatistic"]&,{data1,data2}];

The test statistic given a particular alternative:

T2=MapThread[ConoverTest[{#1,#2},2,"TestStatistic"]&,{data1,data2}];

Compare the distributions of the test statistics:

SmoothHistogram[{T1,T2},Filling->Axis,PlotLegends->{"(Subscript[H, 0]) is True","(Subscript[H, 0]) is False"}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[HypothesisTestData, paclet:ref/HypothesisTestData])  ▪  (RefLink[LocationTest, paclet:ref/LocationTest])  ▪  (RefLink[LocationEquivalenceTest, paclet:ref/LocationEquivalenceTest])  ▪  (RefLink[VarianceTest, paclet:ref/VarianceTest])  ▪  (RefLink[VarianceEquivalenceTest, paclet:ref/VarianceEquivalenceTest])  ▪  (RefLink[DistributionFitTest, paclet:ref/DistributionFitTest])  ▪  (RefLink[BrownForsytheTest, paclet:ref/BrownForsytheTest])  ▪  (RefLink[FisherRatioTest, paclet:ref/FisherRatioTest])  ▪  (RefLink[LeveneTest, paclet:ref/LeveneTest])  ▪  (RefLink[SiegelTukeyTest, paclet:ref/SiegelTukeyTest])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Hypothesis Tests, paclet:guide/HypothesisTests])}})}})