I stumbled on the quirk given below.
I am working on two implementations, one to test for equality of means using the t-test and another testing for equality of variances using Brown-Forsythe's F-test.
Then I notice that the results are exactly the same!
I have only two groups. I get the same result if I assume equality of variance in the t-test and if I use the mean, not the median, in the F-test (so it really is the Levene test).
Since I use only two groups, the F-test's $\nu_1 = 1$. Now remember when $t \sim t( \nu_2 )$ then $t^2 \sim F( 1, \nu_2 )$.
So I assume the critical $t$ for the means test, squared, is the same as the critical $F$ of the variance test and looking at the formulae it indeed appears to be so.
I also realise that it makes sense that testing for equality of means' deviation, when squared, is the same as the sum of squared deviations from the common mean that is used to test for equality of variances if there are only two groups.
The quirkiness is that the critical value of an equality of means test is the same as the critical value of an equality of variances test.
Based on Dave's excellent comments, I'd like to ask the following.
Suppose I have two data sets that I want to test for equality. I am really interested in testing the means, but it would be interesting to test the variances as well.
My question is if the methodology I propose below is correct.
Since the means test can be done under the assumptions of equal or unequal variances, I test the variances first using Levene (means not medians). The test shows me the variances are not significantly different, so I proceed to test the means under the assumption of equal variances in the t-test.
Does it make sense to do it this way? Especially since I notice that both tests yield the exact same result due to reasons described above.