# Test that two normal distributions have same standard deviation

I have two normal distributions, and I want to test whether they have the same standard deviation, I really don't care about the mean.

My idea is: de-mean both of them and then use Kolmogorov-Smirnov to test if the distributions are different, if they are then standard deviations also should be different.

I am wondering if I am missing anything, and if there is a better way to do this.

-

1) The approach you suggest won't have the null distribution of an actual Kolmogorov-Smirnov-statistic. You could actually do that procedure to compute a test statistic, but to find the p-value you'd have to find the distribution of the resulting test statistic (probably by simulation), or perhaps perform a permutation test.

2) If you know they're normal, the F-test for equality of variances (as mark999 suggested in comments) is probably the way to go, since it will be the likelihood ratio test. If the distributions might be non-normal, that F-test can be badly affected by that assumption failure, and you might instead look at Levene or Brown-Forsythe (also mentioned at the link), or some of the other relatively less sensitive-to-assumptions tests for equality of variance.

(If the sample sizes are equal the level of the F-test is not as badly affected, though the power might still be relatively poor.)

An alternative might be to keep the F-statistic but use it as the basis of a resampling based approach such as a bootstrap or permutation test. But if you're contemplating such a route, it might be wise (because of potential effects of outliers on power) to base it off one of the more robust measures of scale - and if you have near-normal data, you'd probably want to choose one with reasonably good efficiency at the normal (three mentioned at the link are $Q_n$, $S_n$ and the biweight midvariance) .

You might like to search CrossValidated on some of the terms in your question and the responses here - you'll be able to find some additional discussion and advice.

For example one such search turns up this, this, and this, the last of which includes this answer by Alan Forsythe.

Allingham and Rayner[1] suggest a test based off a Wald test for the differences (rather than the ratio) which has much better level-robustness than the F-test on the heavier-tailed-than-normal distributions considered (often almost as good as the Levene on level, but erring on the conservative side while Levene tends to exceed the level) with good power at the normal (slightly beating the Levene at larger sample sizes, not generally as good at very small sample sizes). If both sample sizes are above 25 or so, it's worth considering this test.

Additional searches here will turn up one or two other possibilities besides the ones I mentioned.

[1]: Allingham, D. & J.C.W. Rayner (2012),
"Testing Equality of Variances for Multiple Univariate Normal Populations",
Journal of Statistical Theory and Practice, 6:3, 524-535
(there's a 2011 conference paper version here)

-
Lovely answer. Small quibble: the F test is a test for difference of variances, that is the null hypothesis is equality, and strong enough evidence rejects that in favor of an alternative of different variances. Failure to reject this null hypothesis is not evidence of equality (i.e. fallacy of "accepting the null"). – Alexis Jul 27 '14 at 23:44
@Alexis What you say is correct (+1), but unless I misread something, I don't get the sense that anyone here is making that particular error, at least not in any more substantive sense than via the common laxities in terminology, in the same way as people describe a t-test as a test for equality of mean. It's common to describe tests by their null. (Strictly, it's not testing for a difference in variances either, but testing whether the ratio is something other than 1.) – Glen_b Jul 27 '14 at 23:47
It is a minor point I am making :) ... but the language "test for equality" implies that we are looking for evidence to support the null, rather than looking for evidence to support the alternative. And yes my raising this is me tilting at the windmills of common (linguistic) laxity. – Alexis Jul 28 '14 at 17:02