ForHosting KIT · Developer Utilities

Levene Test Calculator

The Levene test calculator evaluates whether two or more independent groups have equal population variances.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Provide each group as an array of numeric observations, and it returns Levene's statistic with its upper-tail p-value. This implementation uses the classical mean-centered version of the test: it converts every observation to its absolute distance from that group's mean, then compares those distances with a one-way analysis of variance. The calculation is deterministic, requires no network access, and is useful when a normality-sensitive two-sample F test is not a good fit.

What Levene's test measures

Levene's test begins with the null hypothesis that all represented populations have the same variance. For every group, the calculator finds the arithmetic mean and replaces each original observation with its absolute distance from that mean. It then performs a one-way analysis of variance on those distances. If the typical absolute distances differ substantially among groups compared with the variation remaining inside the groups, the statistic becomes large. The returned p-value is the probability, under the equal-variance model and the F reference distribution, of obtaining a statistic at least as large as the observed one. A small p-value therefore provides evidence against equal variances. It is not the probability that the null hypothesis is true, and it does not quantify whether a variance difference is important in the application. A large p-value likewise does not prove that variances are identical; limited sample sizes may simply provide little power to detect a difference. Set a significance threshold before inspecting the result, and interpret the test alongside plots, sample sizes, measurement knowledge, and the practical consequences of unequal spread.

How the calculation is performed

Enter `groups` as an array containing at least two arrays of finite numbers. Every group needs at least two observations, although group sizes do not need to match and the order of observations has no effect. The calculator first computes each group's mean with an incremental update that avoids an unnecessarily large raw sum. It forms absolute deviations from that mean, calculates the mean deviation within every group, and calculates the overall deviation mean weighted by group size. The reported statistic is the between-group mean square divided by the within-group mean square for those deviations. Its numerator degrees of freedom equal the number of groups minus one; its denominator degrees of freedom equal the total observation count minus the number of groups. The p-value is the upper tail of the corresponding F distribution, evaluated deterministically through the regularized incomplete beta function. The response intentionally contains only `statistic` and `p_value`, keeping it straightforward to store, compare, or feed into a documented analysis pipeline. When reporting a result, also preserve the group definitions, sample sizes, chosen threshold, and mean-centered method.

Assumptions, interpretation, and limitations

Observations should be independent within and between groups, and the samples should reasonably represent the populations about which you want to conclude. Levene's procedure is generally less sensitive to departures from normality than the classical F test for two variances, but it is not assumption-free. Strong dependence, biased sampling, measurement rounding, mixtures of populations, or influential outliers can still produce a misleading result. The mean-centered form used here is the original Levene construction. A median-centered Brown–Forsythe variant can be more resistant to heavy tails and extreme observations, but it is a different calculation and is not silently substituted by this capability. Inspect distributions and consider the data-generating process before turning a p-value into a decision. The calculator rejects fewer than two groups, groups shorter than two observations, nonnumeric or non-finite values, and inputs beyond its declared bounds. It also reports an error when all within-group absolute deviations lack variation, because the denominator of the statistic is then zero and an ordinary finite F statistic cannot be calculated. Statistical significance alone does not establish causation, data quality, or meaningful effect size.

Check an analysis assumption

Assess homogeneity of variance before choosing a method that relies on comparable group spreads.

Compare process consistency

Test whether measurements from several production lines show evidence of unequal variability.

Audit a published calculation

Reproduce a mean-centered Levene statistic and p-value from the underlying group observations.

How many groups can I compare?

You must provide at least two groups and may provide up to the declared limit of forty groups.

Is this version centered on the mean or median?

It is the classical mean-centered Levene test. It does not calculate the median-centered Brown–Forsythe variant.

What does a small p-value mean?

It indicates that the observed difference in group spreads would be unusual under the equal-variance null hypothesis, subject to the test assumptions.

Does a large p-value prove equal variances?

No. It means the samples do not provide strong evidence against equality; it does not establish that the population variances are identical.

Why can constant or symmetric groups cause an error?

If the absolute deviations have no within-group variation, the statistic's denominator is zero and a finite ordinary test statistic is undefined.

What does an API calculation cost?

Each API request costs $0.002. The browser and API use the same deterministic analytic calculation.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/levene-test

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/levene-test \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"groups":[[10,12,9,11,13],[8,15,7,16,9,14],[11,10,12,9,10]]}'
{
  "groups": [
    [
      10,
      12,
      9,
      11,
      13
    ],
    [
      8,
      15,
      7,
      16,
      9,
      14
    ],
    [
      11,
      10,
      12,
      9,
      10
    ]
  ]
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.levene_test",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_groups40
max_items_per_group100000
max_total_items200000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →