gizmobench

Levene Test Calculator

Levene's test asks whether several groups spread out by different amounts, and it answers by running a one-way ANOVA on each value's absolute distance from its own group's center. This page shows that working instead of hiding it. The groups 1, 2, 3, 4, 5 and 1, 3, 5, 7, 9 and 2, 3, 3, 4, 8 have means of 3, 5 and 4, their absolute deviations from those means average 1.2, 2.4 and 1.6, and the ANOVA of those deviations gives F 0.965517 on 2 and 12 degrees of freedom with p = 0.408495, every figure on screen where it can be checked. Switch the center to the median and the same groups give the Brown-Forsythe test, F 0.794872 with p = 0.474045. The arithmetic is exact on the digits you type, with F rounded once at the end, so adding a constant to every value or multiplying every value by the same nonzero number leaves F where it was, and when the deviations inside every group are identical F is reported as undefined rather than as an enormous number. Nothing is dropped: a word or an NA is refused with its group and position, and every value appears in the deviation table, the copied report and the CSV.

Your groups

Center

Absolute deviations from each group's mean: Levene's original test.

Group 1
Group 2
Group 3

3 of up to 20 groups, and up to 10,000 values across them.

ResultMean (Levene)Example data

2468Group 1Group 2Group 3

Text equivalent: 3 groups on one axis, each group's mean marked with a vertical line. Group 1: 5 values from 1 to 5, mean 3. Group 2: 5 values from 1 to 9, mean 5. Group 3: 5 values from 2 to 8, mean 4.

Example data: three groups of five, mean-centered. Replace them with your own values and run the test.

F
0.965517
Degrees of freedom
2, 12
p
0.408495
Against alpha 0.05
p not below alpha

p = 0.408495 is not below alpha = 0.05.

ANOVA on the absolute deviations

SourceSSdfMSFp
Between groups3.7333321.866670.9655170.408495
Within groups23.2121.93333
Total26.933314

Groups

GroupnMeanMedianVarianceSDMean deviation from meanDeviation SS
Group 15332.51.581141.22.8
Group 2555103.162282.411.2
Group 35435.52.345211.69.2

Variance and SD use n - 1. The deviations are taken from each group's mean, and the ANOVA above is run on them.

Absolute deviations

GroupPositionValue as enteredGroup meanAbsolute deviation
Group 11132
Group 12231
Group 13330
Group 14431
Group 15532
Group 21154
Group 22352
Group 23550
Group 24752
Group 25954
Group 31242
Group 32341
Group 33341
Group 34440
Group 35844
Rows 1 to 15 of 15
  • Each value is replaced by its absolute distance from its own group's mean, and a one-way ANOVA is run on those distances; its F is Levene's statistic.
  • The p-value is the upper tail of the F distribution on 2 and 12 degrees of freedom; a small p-value is computed directly by the continued fraction, never as one minus a cumulative, so it keeps its digits.
  • The largest sample variance (Group 2) is 4 times the smallest (Group 1).

Assumptions

  • The groups are independent samples, and the values inside each group are independent of one another.
  • Every value entered is used as entered: nothing is deleted, trimmed or set aside as an outlier.
  • The p-value refers the F ratio of the absolute deviations to the F distribution on k - 1 and N - k degrees of freedom, which is how both Levene's test and the Brown-Forsythe test are defined.
  • A p-value that is not below alpha is not evidence that the population variances are equal. The page reports the comparison and chooses no model or next step.

Worked cases

Each line is computed by the same code as the answer above. Load one to fill the groups, then run it.

  • Levene (mean)[1..5], [1, 3, 5, 7, 9], [2, 3, 3, 4, 8]
    F 0.965517, df 2 and 12, p 0.408495
  • Brown-Forsythe (median)the same three groups
    F 0.794872, df 2 and 12, p 0.474045
  • Invariancethe same groups, every value times 3 plus 10
    F 0.965517, df 2 and 12, p 0.408495
  • Zero spread within groups[1, 3, 1, 3], [2, 6, 2, 6], [4, 4, 4]
    F undefined: Inside every group the absolute deviations from the mean are all the same, so the within-group mean square is 0 and F would divide by it. F and p are undefined; the between-group sum of squares is 6.90909.

Common questions

What does Levene's test tell you?
It asks whether the groups come from populations with different variances. Each value is replaced by its absolute distance from its own group's center, and a one-way ANOVA compares the average distance across the groups: groups that spread out more have larger distances. A large F and a small p-value are evidence that the spreads differ. For the groups 1, 2, 3, 4, 5 and 1, 3, 5, 7, 9 and 2, 3, 3, 4, 8 the page reports F 0.965517 on 2 and 12 degrees of freedom and p = 0.408495, which is not below an alpha of 0.05.
What is the difference between Levene's test and the Brown-Forsythe test?
Only the center the distances are measured from. Levene's original test uses each group's mean, and the Brown-Forsythe test uses each group's median, so on this page Brown-Forsythe means the median-centered Levene test, not the Brown-Forsythe test for comparing means. The example groups have means of 3, 5 and 4 and medians of 3, 5 and 3, so the two versions differ only in the third group, and they give F 0.965517 with p = 0.408495 against F 0.794872 with p = 0.474045. One extreme value moves a median less than a mean, which is the reason usually given for the median version when a group is skewed. The Center switch picks either one for the same data, and Run test computes it.
How do I read the p-value from Levene's test?
It is the chance, under the F distribution the test uses, of an F at least as large as yours if the absolute deviations in every group came from populations with the same mean, which is what equal spread looks like to this test. The page compares it with the alpha you set and says whether p is below alpha or not, and stops there. A p-value that is not below alpha is not evidence of equal variances: small groups can hide a real difference in spread. The page also recommends no follow-up test and chooses no model for you.
Why does it say F is undefined?
Because the within-group mean square is 0 and F would divide by it. Take the groups 1, 3, 1, 3 and 2, 6, 2, 6 and 4, 4, 4: their distances from the group means are all 1, all 2 and all 0, so there is no variation inside any group at all. The page says F and p are undefined and still prints the between-group sum of squares, instead of printing a huge F or a p of 0. The arithmetic is exact, so a zero here really is zero and not a rounding error.
Does adding a constant or changing units change the result?
No. Adding the same number to every value leaves every distance from the center unchanged, and multiplying every value by the same nonzero number scales every distance by the same factor, which cancels in F. The worked case that takes the example groups times 3 plus 10 gives F 0.965517 on 2 and 12 degrees of freedom, the same as the original, and because the arithmetic is exact it is the same to the last digit rather than merely close.
How much data can I enter?
From 2 to 20 groups, with at least 3 values in each and up to 10,000 values across all of them, each value with up to 50 significant digits. Past a limit the page refuses and names both numbers rather than trimming anything. Values can be separated by spaces, commas, semicolons or new lines, so a column pasted from a spreadsheet works. The values stay in this browser tab: the page remembers only the center and alpha you chose, never the data.
What happens to missing values or text in my data?
They are refused, not skipped. An entry such as NA or a word is reported with its group and its position, for example Group 2, value 3, and nothing is computed until it is deleted or replaced. The same goes for a number written with a thousands separator such as 1,250, because a comma also separates values here and the page will not guess which was meant. No value is ever removed on its own or treated as an outlier.
How accurate is the p-value?
The p-value is the upper tail of the F distribution at the stated degrees of freedom; a small p-value is computed directly by the continued fraction, never as one minus a cumulative, so it keeps its digits. It was measured against exact rational values and 80-digit reference values and agrees with them to within 1e-12 in relative terms. A tail smaller than about 1e-300, past what a double holds, is printed from its logarithm instead of as 0, and those logarithms were held to the same 1e-12 against the exact values.
What can I export?
Copy report puts the test, F, the degrees of freedom, p, the ANOVA table, each group's mean, median, variance and SD, every value with its absolute deviation, the notes and the assumptions on the clipboard. Download CSV saves the same figures as a spreadsheet file at full precision, one row per value. Group names that begin with =, +, - or @ get a leading apostrophe in the CSV so a spreadsheet does not read them as formulas.

Tests evidence of differing population variances under independent sampling; a nonsignificant result does not prove equality. No automatic deletion, model selection or safety/quality certification. Brown-Forsythe here means median-centered Levene, not a mean-test variant.