# F-test of equality of variances

Hi all,

I was wondering if there was a way to conduct a Bayesian F-test of equality of variances - I have two groups and I want to show that their variances are equal (H0 is true).

Is there a way to do this with JASP? or R? or any other way (I have a calculator and I'm not afraid to use it!)?

Thanks,

M

## Comments

Hi M,

This is on our to-do list. A recent paper on the topic is here:

http://sci-hub.cc/10.1016/j.jmp.2015.08.001

I'm not sure whether there is R code, but I expect there is.

Cheers,

E.J.

Thanks EJ!

Hi all,

I was wandering the same thing as MSB, and the link E.J. gave is dead now.

I am looking for a Bayesian way to compare hypotheses of equal and unequal variances in two groups in the same way as it is usually done with means (with calculating BF). Does anyone know how to do this in R or in any other software?

Thanks for your help,

Izymil

If you have two groups...one strategy might be to take the F value from the Levene's test...square root it to turn it into a t value...and then use the "summary stats" feature within JASP.

Maybe that is a good approximation (in some circumstances...haven't checked it out) but it's not the real thing (i.e., computing a ratio of marginal likelihoods), and we need the real thing to check whether and under what circumstances the approximation is good.

E.J.

@EJ - Does it mean, that I need something more than it is currently availabe in JASP? Any chances you might have a clue, where can search for this "real thing"?

:-) The real thing is a direct comparison of variances. We have something really cool under development here (there will be a blog post and a preprint once it's done), but there is also recent work in the Tilburg lab of Joris Mulder. This is not in JASP (yet) but will give you an idea, and perhaps they have R code.

E.J.

I suppose my thinking was as follows

If we take the levenes test in the frequentist model...it appears that it is essentially a one-way ANOVA across each groups deviation from the mean

Example 1:

3 separate groups

if we run a one-way anova on this and click levenes test

we get the following for the one-way ANOVA

F = 2.608, p =0.114

for the levenes test we get

F=1.367, p = 0.2916

now if we want to run the levenes ourselves...we look at each group and take each value minus the mean of each group

Group 0: 6.4

Group 1: 4.2

Group 2: 7.0

when we take each value minus the mean, we get the following

now we would turn each negative to a positive

now if we run a one way anova with "all values made +" as the dependent variable and "group" as indepdendent variable, we get the following

F= 1.367, p =0.2916

this is the same result as the original levenes test

if we ran it through Bayes, we get the following

BF10: 0.635

jploenneke Yes. Another way to put it is: Levene's test is just a oneway ANOVA on dispersion scores (absolute deviations from the group mean) that indirectly tests the equality of variance in the un-transformed scores. So a Bayesian one-factor ANOVA on dispersion scores is equivalent to a Bayesian Levene's test.

Richard Anderson

Hmm this is interesting, I'll pass this on.

Cheers,

E.J.

I start to see some bright blue sky shining through the clouds :D Thank you all.

E.J. - I would gratefully use this cool thing, let us know when you're done :)

If I would compare variance not between the whole groups but between the within-subject variance in group A and group B, would it change something you all said?

Participants in group A answer to items x,y and z and so are participants in group B. My hypothesis would be, that participants in group A would have greater variance between x,y,z than participants in group B.

Best, Izymil

Ah I see. Well but then you can simple compute the sample variance per subject and t-test this between the groups? Of course this ignores the uncertainty about the sample variance, but that would be the approach that people are often using currently.

Cheers,

E.J.

But the variances would not approximate normal distributions, which would be problematic for a t test. Wouldn't the most straight-forward, well-established way to do this be to simply run a repeated-measures ANOVA with Condition (with levels X, Y, and Z) as a repeated measure and Group as a between-subject measure? In the results, the interaction term would be interpretable as degree to which the variance in the DV, across the levels of Condition, depends on group.

Richard Anderson

What needs to be normal is the distribution of variances across subjects, right? I don't see why that wouldn't be (approximately) normal.

In your RM ANOVA, I am not sure how your ultimate test involves the variance across the x,y,z. The interaction term would mean that the effect of x,y,z differ depending on the group. This may happen without variances coming into play.

Cheers,

E.J.