# Are these possible LeveneTest results?

I have experimental data of response times that differ according to the factor TrialType: Regular or Random. I also have two groups, A and B, which I expect to behave the same (they were created for counterbalancing purposes).

I want to test the equality of variance assumption in my data. I am pretty sure the variances are not equal, but I want to show it with a test anyway.

My data is contained in a long data.frame called AB:

summary(AB)
Block          Trial         TrialType      Subject          variable      value
Block1:1930   Min.   :  1.0   Random :5889   Length:9852        RT:9852   Min.   : 348.0
Block2:1974   1st Qu.:128.0   Regular:3963   Class :character             1st Qu.: 595.0
Block3:1982   Median :252.0                  Mode  :character             Median : 692.0
Block4:1983   Mean   :251.9                                               Mean   : 765.7
Block5:1983   3rd Qu.:376.0                                               3rd Qu.: 834.0
Max.   :500.0                                               Max.   :4412.0
Group
A:4929
B:4923


I tried the Levene Test using both Group and TrialType as grouping factor (the second argument):

leveneTest(AB$value,AB$Group)

leveneTest(AB$value,AB$TrialType)


As you can see, I am still unclear whether the second argument should be Group (A and B) or TrialType (random and regular). I just tried both.

For group, the p-value it was 8.479e-11, and for TrialType, p was 2.413e-12. Also, the degrees of freedom for both cases is 1, and the F values are very high: 42,23 for Group and 49.24 for TrialType. So the 3 values I am getting from these tests seem highly unusual. Therefore I suspect I might be doing something wrong. Any comments or/and help is much appreciated. Also, any tips on how to report these results would be most welcome.

Remember it's the residuals from your model that should be distributed with equal variances. You want to use Group & TrialType together as grouping factors: leveneTest(value~TrialType*Group, data=AB).