Statistical Diagnostics calculator

Shapiro-Wilk normality test calculator

Test whether a sample distribution departs significantly from normality using the Shapiro-Wilk W statistic and p-value.

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

When to use it

Use to test continuous data for normality prior to applying parametric inferential tests.

Required Inputs

  • Sample numeric data array (N = 3 to 5,000)
  • Alpha significance level (typically 0.05)

Mathematical Formula

W = [ Σ a_i x_(i) ]² / Σ (x_i - X̄)²

Reporting Cautions

  • In large samples (N > 500), small trivial departures from normality will yield significant p-values.
  • In small samples (N < 20), test power to detect non-normality is low.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from scipy import stats
W, p = stats.shapiro(sample_data)
print(f"W={W:.4f}, p={p:.4f}")
R Language
shapiro.test(sample_data)
TypeScript (@statlab/core)
import { shapiroWilk } from '@statlab/core';
const res = shapiroWilk(sampleData);

Developer Use Cases & Production Integrations

  • Validating normality assumptions before deciding between Student/Welch t-test vs Mann-Whitney U test.
  • Automated assumption checking in VoxelAssurance statistical pipeline gates.

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.