Levene's Test Calculator
Test whether independent groups have equal variances. Enter observations for two or more groups, one per line, choose mean or median centering, and get the F statistic, degrees of freedom, and p-value.
Check Whether Independent Groups Have Equal Variances
Levene's Test Formula
Where:
- \(k\) — number of groups
- \(N\) — total number of observations across all groups
- \(n_i\) — number of observations in group \(i\)
- \(Z_{ij} = |Y_{ij} - \tilde{Y}_i|\) — the absolute deviation of observation \(j\) in group \(i\) from its group center (mean for the original Levene test, median for the Brown–Forsythe variant)
- \(\bar{Z}_i\) — mean of the absolute deviations in group \(i\)
- \(\bar{Z}\) — mean of all absolute deviations
The statistic \(W\) follows an F-distribution with \(k-1\) and \(N-k\) degrees of freedom under the null hypothesis that all group variances are equal. It is essentially a one-way ANOVA performed on the absolute deviations from the group centers.
Levene's Test – Calculation Example
Example: three groups of five measurements each, tested with the default median-centered (Brown–Forsythe) method.
Group 1: 8, 9, 10, 11, 12 Group 2: 8, 10, 12, 14, 16 Group 3: 9, 10, 11, 12, 13
Group medians: 10, 12, 11. Absolute deviations from the medians:
\[ Z_1 = 2, 1, 0, 1, 2 \quad (\bar{Z}_1 = 1.2) \]
\[ Z_2 = 4, 2, 0, 2, 4 \quad (\bar{Z}_2 = 2.4), \qquad Z_3 = 2, 1, 0, 1, 2 \quad (\bar{Z}_3 = 1.2) \]
Overall mean deviation: \(\bar{Z} = 24/15 = 1.6\).
\[ \sum n_i (\bar{Z}_i - \bar{Z})^2 = 5(0.4)^2 + 5(0.8)^2 + 5(0.4)^2 = 4.8 \]
\[ \sum\sum (Z_{ij} - \bar{Z}_i)^2 = 2.8 + 11.2 + 2.8 = 16.8 \]
\[ W = \frac{15 - 3}{3 - 1} \cdot \frac{4.8}{16.8} = 6 \cdot 0.2857 = 1.7143 \]
With \(df_1 = 2\) and \(df_2 = 12\), the p-value is \(p \approx 0.221\).
Result: \(F = 1.7143\), \(df_1 = 2\), \(df_2 = 12\), \(p \approx 0.221\). Since \(p > 0.05\), there is no sufficient evidence against equal variances in these three groups.
How to Use the Levene's Test Calculator
- Type your data into the Group observations field, with each group's values on its own line. Separate values with spaces or semicolons; decimal commas are accepted. Each group needs at least two observations, and you can enter between 2 and 20 groups.
- Choose the centering method in the Center each group on its dropdown: Mean (Levene's original test) or Median (Brown–Forsythe variant).
- Read the results: the test statistic F, the two degrees of freedom, the p-value, and a plain-language interpretation of whether the group variances can be assumed equal at the 0.05 level.
What Is Levene's Test and When Do You Need It?
Levene's test is a statistical procedure for checking the homogeneity of variance assumption — the idea that several independent groups share the same population variance. Many classical methods, including the two-sample t-test, one-way ANOVA, and repeated-measures designs, assume equal variances across groups. When that assumption fails, the nominal error rates of these tests can be distorted: you may declare a result "significant" more often than the stated 5%, or lose power.
The test works by transforming the raw data. Each observation is replaced by its absolute distance from the group center, and a one-way ANOVA is run on those distances. If the groups truly have equal variances, the average absolute deviation will be similar across groups, and the resulting F statistic will be small. If one group is noticeably more spread out than the others, its deviations will be larger on average, inflating the statistic.
Interpreting the output is straightforward: a small p-value (typically below 0.05) provides evidence that at least one group's variance differs, so you should either use a variance-stabilizing transformation (e.g., a log transform) or switch to a procedure that does not assume equal variances, such as Welch's ANOVA. A large p-value means the data are consistent with equal variances — but it does not prove the variances are exactly equal. The test simply finds no evidence against the assumption.
Levene's test is usually preferred over older alternatives such as Bartlett's test because it is far less sensitive to non-normal data. It is a natural companion to parametric group comparisons; if you later move to nonparametric methods, the Kruskal–Wallis Test or the Friedman Test may be appropriate depending on your design.
Assumptions, Limitations, and Practical Tips
- Independence. Observations must be independent within and between groups. Levene's test is not appropriate for paired or repeated-measures data.
- Two versions of the test. The original Levene test centers each group on its mean, which makes it sensitive to outliers and skewed distributions. The Brown–Forsythe variant centers on the median and is more robust; it is the default in this calculator and in most statistical software.
- Group size matters. With very small groups, the test has low power and may miss real differences in variance. With very large samples, it can flag trivially small differences as significant. Always consider the practical size of the variance difference, not just the p-value.
- Equal variances is not the same as equal means. This test says nothing about whether group averages differ — it only examines spread. To compare means across groups, look instead at procedures such as the Z-Test for a Mean.
- Don't forget the underlying test. A variance check is usually a preliminary step. If your design continues to further analysis, the Statistical Power Calculator can help you assess whether your sample sizes are adequate for detecting the effects you care about.
- Sensible data limits. The calculator accepts up to 20 groups and 1,000 observations in total, with values up to a trillion in absolute value — enough for typical classroom and research datasets.
Frequently Asked Questions
What p-value means the variances are different?
A p-value below your significance level (commonly 0.05) indicates that at least one group's variance differs from the others. For example, \(p = 0.01\) means such a difference in spread would rarely occur by chance if the true variances were equal. A p-value above 0.05 means the test found no evidence against equal variances — but that is not proof that they are exactly equal, especially with small samples.
Should I use mean or median centering?
Use median centering (the Brown–Forsythe variant) in most situations, because it is more robust to outliers and skewed distributions and gives more reliable results when data are not perfectly normal. Choose mean centering only if you specifically need to reproduce the original Levene test, for example to match a textbook example or a report that used the classical version. When in doubt, the median-based result is the safer choice.
Can Levene's test be used for only two groups?
Yes, the test works with two groups as well as with many. With two groups, \(df_1 = 1\) and \(df_2 = n_1 + n_2 - 2\). It is a valid alternative to the F-test of two variances and is preferred when the data may not be normally distributed, since the classical two-variance F-test is highly sensitive to non-normality.
What should I do if the test is significant?
You have two main options. First, apply a variance-stabilizing transformation to the data, such as a log or square-root transform, and re-run the test. Second, switch to a method that does not assume equal variances — Welch's t-test for two groups or Welch's ANOVA for several. Do not simply proceed with the standard t-test or ANOVA, as your stated significance level may no longer be accurate.
How do I report Levene's test results in a paper?
A typical APA-style report includes the test statistic, both degrees of freedom, and the p-value, for example: \(F(2, 12) = 1.71\), \(p = 0.221\). State which version you used — the original mean-centered test or the median-centered Brown–Forsythe variant — since the two can give different values on the same data. Also mention your significance level if it differs from 0.05.
Why is my F statistic infinite?
This happens when all absolute deviations within each group are identical (zero within-group variation) but their group averages differ. The denominator of the F ratio becomes zero while the numerator stays positive, so the statistic grows without bound and the p-value is effectively zero. In practice this usually means very small groups with unusual patterns — add more observations or double-check the data entry before drawing conclusions.
Does Levene's test work with small samples?
It runs mathematically with as few as two observations per group, but its power is low with small samples, so real differences in variance may go undetected. A non-significant result with 3–5 observations per group is weak evidence of homogeneity. Conversely, with very large samples the test can flag tiny, practically irrelevant differences. In both cases, look at the actual spread of each group (for example, group standard deviations) alongside the p-value.