Categorical calculator

Two-proportion z-test calculator

Compare two independent sample conversion rates or proportions using the two-proportion z-test with pooled variance, p-values, and confidence intervals.

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

When to use it

Use when comparing success rates between two independent large sample groups.

Required Inputs

  • Group A successes & N
  • Group B successes & N
  • Confidence level
  • Alternative hypothesis

Mathematical Formula

z = (p̂_1 - p̂_2) / √[ p̂(1 - p̂)(1/n_1 + 1/n_2) ]

Reporting Cautions

  • Requires n*p >= 5 and n*(1-p) >= 5 in both sample groups.
  • Use Fisher’s Exact Test for small sample sizes.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from statsmodels.stats.proportion import proportions_ztest
z, p = proportions_ztest([160, 120], [1000, 1000])
print(f"z={z:.4f}, p={p:.4f}")
R Language
prop.test(c(160, 120), c(1000, 1000))
TypeScript (@statlab/core)
import { zTestTwoProps } from '@statlab/core';
const res = zTestTwoProps(120, 1000, 160, 1000);

Developer Use Cases & Production Integrations

  • Comparing baseline vs variant conversion proportions in VoxelPulse telemetry.
  • Evaluating build pass rates across server fleets.

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.