I just read that the Ansari-Bradley test is a test of stochastic equality of two variances regardless of any distributional assumptions. If it is so flexible, why do we even need the F test?

I am confused, as for the Ansari-Bradley test it is said it is about "scale parameters", not just "variances". But whenever I go to read about the scale parameters, scaling the "width" of the distribution, there is a reference to variance.

Is somehow the F test bound to the normal distribution? Variance in general applies to any distribution, not just the normal. But I thought this may be important?

I found, when using the R statistical package, that both tests may differ a lot, sometimes the var.test() reports low p-value while the Ansari-Bradley test reports high p.value.


> a <- c(1,2,3,4,5,10,12,14,15,20,30,40,50,60,70,100)
> b <- c(1.1,1.2,3,3.3,5.5,10.1,10.3,14.1,15.1,20.1,31,32,33,34,35)
> ansari.test(a, b)

    Ansari-Bradley test

data:  a and b
AB = 121.5, p-value = 0.4013
alternative hypothesis: true ratio of scales is not equal to 1

Warning message:
In ansari.test.default(a, b) : cannot compute exact p-value with ties
> var.test(a, b)

    F test to compare two variances

data:  a and b
F = 4.9132, num df = 15, denom df = 14, p-value = 0.004904
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
  1.665875 14.206412
sample estimates:
ratio of variances 

1 Answer 1


When the distributions are normal, the F-test is more powerful.

B <- 1000
N <- 30
ps_a <- ps_f <- rep(NA, B)
for (i in 1:B){
    x <- rnorm(N, 0, 1)
    y <- rnorm(N, 0, 2)
    ps_a[i] <- ansari.test(x, y)$p.value
    ps_f[i] <- var.test(x, y)$p.value
length(ps_a[ps_a<=0.05]) # 780 of 1000 correctly reject
length(ps_f[ps_f<=0.05]) # 958 of 1000 correctly reject

You can tweak this simple simulation to get additional insight, but the vanilla parametric methods are tough to beat when their assumptions are met.

However, the usual way to use an F-test is in regression (ANOVA is a special case of linear regression), where we can use it to test parameters or groups of parameters.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.