Statistical Diagnostics calculator

Levene's test for equality of variances calculator

Perform Levene's test or Brown-Forsythe test for homoscedasticity across two or more sample groups.

Run this test live in StatLab npm i @statlab/core

When to use it

Use before ANOVA or independent t-tests to verify equal variance assumptions.

Required Inputs

  • Sample groups data
  • Center metric choice (Mean / Median / Trimmed Mean)

Mathematical Formula

W = [ (N - k)/(k - 1) ] * [ Σ n_i (Z̄_i. - Z̄..)² / Σ Σ (Z_ij - Z̄_i.)² ], where Z_ij = |Y_ij - Ỹ_i|

Reporting Cautions

  • Use median centering (Brown-Forsythe variant) when data is skewed or heavy-tailed.
  • Significant Levene result indicates variance inequality.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from scipy import stats
stat, p = stats.levene(g1, g2, g3, center='median')
print(f"W={stat:.4f}, p={p:.4f}")
R Language
library(car)
leveneTest(val ~ group, data = df, center = median)
TypeScript (@statlab/core)
import { leveneTest } from '@statlab/core';
const res = leveneTest([g1, g2, g3]);

Developer Use Cases & Production Integrations

  • Checking homoscedasticity before choosing pooled ANOVA vs Welch ANOVA in VoxelPulse.
  • Detecting variance instability across server configurations.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.