Categorical calculator

Cramér's V and Phi coefficient calculator

Calculate Cramér's V and Phi (φ) effect size coefficients for categorical contingency tables.

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

When to use it

Use alongside Chi-square tests to report nominal association strength.

Required Inputs

  • Contingency matrix or Chi-square statistic
  • Number of rows & columns
  • Total N

Mathematical Formula

V = √( χ² / (N * min(r-1, c-1)) )

Reporting Cautions

  • V ranges from 0.0 (no association) to 1.0 (perfect association).
  • For 2x2 tables, Cramér’s V equals the absolute value of the Phi coefficient.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
import scipy.stats as stats
def cramers_v(chi2, n, r, c):
    return np.sqrt(chi2 / (n * min(r-1, c-1)))
R Language
library(rcompanion)
cramerV(matrix)
TypeScript (@statlab/core)
import { cramersV } from '@statlab/core';
const v = cramersV(chi2, n, r, c);

Developer Use Cases & Production Integrations

  • Measuring categorical association strength between telemetry event types.
  • Quantifying effect magnitude for chi-square tests in VoxelPulse.

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.