Skip to content

BCompare groups · distribution.compare

Compare distributions (two or more groups)

Do the groups come from the same distribution — anywhere, not only in their centers?

Whole-distribution tests across groups: two-sample Kolmogorov–Smirnov (exact, also one-sided), the k-sample Anderson–Darling test of Scholz and Stephens, two-sample Cramér–von Mises, Baumgartner–Weiß–Schindler, Epps–Singleton, the Lepage and Cucconi location-and-scale tests and the Wald–Wolfowitz runs test, singly or side by side. Permutation p-values come from a shared seeded stream (same in Python and R); the KS distance D is reported as the effect, optionally against a smallest difference of interest.

Verified in Python and R Python and R agree to 6 decimals Seeded Also called two-sample Kolmogorov–Smirnov, KS test two sample, ks.test…

A real result

Example “Auto three shapes”, recorded in both engines. In the app, “Try this example” loads it into Analyze.

Distribution comparison — Anderson–Darling k-sampleRecorded · Python and R agreeRecorded 2026-11-17 · 11 values compared
R

Anderson–Darling k-sample test, statistic = 7.13, p = .004

Statistic
7.134
p
0.0040

Plots

ECDFs of value by groupWhat share of values falls below any threshold, and how do groups differ across the whole range?
View data
groupvalue
A17
A19.800
A19.300
A17.500
A22.300
A19.500
A22.900
A25.100
A20.800
A21.100
A23.500
A21.900
A23.900
A20.600
A24.800
A19.800
A22.500
A20.500
A21.900
A21.900
A22
A18
A17.800
A25
A18.200
A23.500
A20.400
A20.800
A21.100
A17.900
B12.900
B14.200
B14.700
B−1.300
B11.500
B17.300
B15.300
B15
B20.300
B16.300
B21.500
B18
B18.800
B27.300
B31.400
B20.400
B30.500
B18.600
B23.300
B14.100
B21.900
B34.700
B23.300
B19.800
B15
B27.500
B11.700
B18
C19.900
C19.400

First 60 of 83 rows.

Assumptions

  • Independent groups — Each value belongs to one group and the groups are sampled independently.

Distribution tests

TestStatisticdfpp-value from
Anderson–Darling k-sample7.134—.004permutation

Groups

groupnMedianIQR
A3020.9502.875
B2818.3007.325
C2520.1004.300
  • Distribution tests compare whole distributions, not just centers: a small p says the shapes, spreads or locations differ somewhere.
  • Permutation p-values relabel the pooled values 499 times (seed 42); the smallest possible p is 1/500.
Python

Anderson–Darling k-sample test, statistic = 7.13, p = .004

Statistic
7.134
p
0.0040

To keep this page light, the plots are shown once, under the R tab.

Assumptions

  • Independent groups — Each value belongs to one group and the groups are sampled independently.

Distribution tests

TestStatisticdfpp-value from
Anderson–Darling k-sample7.134—.004permutation

Groups

groupnMedianIQR
A3020.9502.875
B2818.3007.325
C2520.1004.300
  • Distribution tests compare whole distributions, not just centers: a small p says the shapes, spreads or locations differ somewhere.
  • Permutation p-values relabel the pooled values 499 times (seed 42); the smallest possible p is 1/500.

Do it in CodeSplash Run it on your own data, in Python or R, with the code to prove it.

Worked examples in the app

  • Auto three shapesh_shift · group: group · outcome: value
  • Ks toothgrowthtoothgrowth · group: supp · outcome: len
  • Ks greater permtoothgrowth · group: supp · outcome: len
  • Ad chickwtschickwts · group: feed · outcome: weight
  • Ad asymptoticchickwts · group: feed · outcome: weight
  • Cvm toothgrowthtoothgrowth · group: supp · outcome: len
  • Bws toothgrowthtoothgrowth · group: supp · outcome: len
  • Es toothgrowthtoothgrowth · group: supp · outcome: len

In the guides

Tests from the statistics guide this method runs

Where it sits in the decision guides

  • Two independent groups (continuous): Student / Welch t, Mann–Whitney U · Statistics Guide · B — Compare groups
  • Non-parametric alternatives · Statistics Guide · Additional considerations

What you need

Outcomenumeric · 1 column
The numeric variable whose distribution is compared across the groups.
Groupscategorical / boolean · 1 column · 2–20 levels
The groups whose distributions are compared. Most tests take two groups; Anderson–Darling takes any number.

Choices you make

options

Testdefault auto

Which test. Automatic uses Kolmogorov–Smirnov for two groups and Anderson–Darling for more.

  • Automatic(default) — Kolmogorov–Smirnov for two groups, Anderson–Darling k-sample for three or more.
  • All tests side by side — Every test that applies, with how many reject; read them as a robustness check, not a vote.
  • Kolmogorov–Smirnov — Largest gap between the two ECDFs; exact p for small samples; sensitive in the middle.
  • Anderson–Darling k-sample — Weighted squared gaps that stress the tails; any number of groups; more powerful than KS.
  • Cramér–von Mises — Squared ECDF gaps summed over the pooled sample.
  • Baumgartner–Weiß–Schindler — Rank-based, variance-weighted squared gaps; often the most powerful two-sample test.
  • Epps–Singleton — Compares empirical characteristic functions; works with discrete data too.
  • Lepage (location and scale) — Wilcoxon plus Ansari–Bradley: a joint test of center and spread.
  • Cucconi (location and scale) — One rank statistic for center and spread together; not built from two tests.
  • Wald–Wolfowitz runs — Counts runs of group labels in the pooled order; weak, kept for the record.
p-value fromdefault auto

Automatic picks exact, asymptotic or permutation per test (KS exact for m·n < 10,000; permutation for AD, BWS, Lepage, Cucconi).

  • Automatic(default) — Picks exact, formula or permutation for each test; the usual choice.
  • Exact (KS, runs) — Uses the exact null distribution for the KS and runs tests; best for small samples without ties.
  • Asymptotic formula — Uses large-sample formulas; fast, and accurate when the groups are large.
  • Permutation (shared seeded stream) — Reshuffles group labels with a seeded stream; valid at any size, slower, and the same in Python and R.

hypothesis

Alternative (KS)default two.sided

One-sided KS asks whether one group's values tend to be smaller (its ECDF lies above the other's).

  • Distributions differ(default) — Tests for any difference between the distributions in either direction; keep it unless you fixed a direction before seeing the data.
  • First group's ECDF above (its values tend to be smaller) — Tests only for the first group's values tending to be smaller; pick it only if you fixed this direction before seeing the data.
  • First group's ECDF below (its values tend to be larger) — Tests only for the first group's values tending to be larger; pick it only if you fixed this direction before seeing the data.

Advanced

Permutationsdefault 1999

Relabelings of the pooled values for permutation p-values (same stream in Python and R).

Smallest KS distance of interestdefault —

Two groups: say whether the observed D (largest ECDF gap) exceeds this practically important difference.

Checks and remedies

CodeSplash checks each testable assumption on every run and shows the result on the card; premises the data can’t test are marked. If a check fails, these are the ways forward.

  • Independent groups

    Each value belongs to one group and the groups are sampled independently; for paired data compare the differences instead.

What it reports

  • Tests: Same distribution in every group
n
How many independent units the analysis used; it sets precision and power.
groups
How many groups' distributions were compared. With two, the summary also gives the largest gap between their ECDFs.
test
The exact variant that ran (for example Welch vs classic F), shown so the result can be reported and reproduced.
statistic
One test of "every component null holds" from several independent tests' p-values.
p
How surprising your data would be if the null hypothesis were true, as a probability.
calibration
Each p-value comes from a reference distribution, a simulation of the null, or an exact count: this column says which.
ks_d
Compares distributions by the largest vertical gap (D) between their cumulative curves.
n_reject
How many independent units the analysis used; it sets precision and power.

Per group, level or term: n[<group>], stat[<test>] and p[<test>] when test = all

Python and R

Python and R agree to 6 decimals (relative tolerance 1e-10). Python uses pandas, numpy, scipy, codesplash; R uses stats, nanoparquet, codesplashr.

Default traps between the two languages

  • Both engines use the shared twins (codesplash.stats.distribution / edf ↔ codesplashr), written from the papers; permutation p-values relabel with the same Wichmann–Hill uniforms (identical counts).
  • Exact two-sample KS p-values check the bound only where the pooled sample changes value, which is exact conditionally on ties (matches R's ks.test exact = TRUE, e.g. p = 0.04831717 on a rounded sample).
  • BWS and Epps–Singleton statistics equal scipy.stats.bws_test / epps_singleton_2samp; Anderson–Darling uses Scholz & Stephens' midrank A²akN (scipy's anderson_ksamp reports the standardized version, also published here as part of the asymptotic option).
Python

The exact script CodeSplash ran for example “Auto three shapes” · Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0

# Compare distributions (two or more groups)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method distribution.compare 1.0.1 · spec 3c10bdb2287603d4
# Dataset: h_shift (version 1)
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
import math

import numpy as np
import pandas as pd

import codesplash as cs
from codesplash.stats import distribution as csd

# %% Data
df = pd.read_parquet("tests/parity/fixtures/h_shift.parquet", columns=["value", "group"])
n_input = len(df)
df["group"] = pd.Categorical(df["group"], categories=["A", "B", "C"])  # stored level order
df = df.dropna(subset=["value", "group"])  # listwise deletion over the analysis columns
df["group"] = df["group"].cat.remove_unused_categories()
n_dropped = n_input - len(df)
warnings = []
if n_dropped:
    warnings.append(cs.cs_warning("CS_W_ROWS_DROPPED", dropped=n_dropped, total=n_input))
if n_input and not len(df):
    cs.cs_error("CS_E_NO_ROWS")
cs.check_finite_columns(df, ["value", "group"])  # infinite values stop the run (registry/errors.yaml)

# %% Test
y = "value"
g = "group"
levels = [str(lv) for lv in df[g].cat.categories if (df[g] == lv).any()]
groups = [df.loc[df[g] == lv, y].to_numpy(dtype=float) for lv in df[g].cat.categories if (df[g] == lv).any()]
k = len(groups)
test = "auto"
alternative = "two.sided"
calibration = "auto"
seed, reps = 42, int(499)  # permutations relabel the pooled sample with the shared Wichmann–Hill stream
sesoi = None
alpha = 0.05
if k < 2:
    cs.cs_error("CS_E_TOO_FEW_GROUPS", column=g, min=2, k=k)
lead = test if test not in ("auto", "all") else ("ks" if k == 2 else "ad")
if k != 2 and lead in csd.TWO_SAMPLE_ONLY:
    raise ValueError(f"The {csd.COMPARE_TESTS[lead]} test compares two groups; {g} has {k}. Use Anderson–Darling k-sample.")
names = [lead] + ([t for t in csd.COMPARE_TESTS if t != lead and (k == 2 or t not in csd.TWO_SAMPLE_ONLY)] if test == "all" else [])
results = [csd.compare_test(groups, t, alternative=alternative if t == "ks" else "two.sided", calibration=calibration, reps=reps, seed=seed) for t in names]
main = results[0]
ks_d = csd.compare_test(groups, "ks")["statistic"] if k == 2 else math.nan

# %% Result
values = {"n": int(sum(len(x) for x in groups)), "groups": k, "test": lead, "statistic": main["statistic"], "p": main["p"],
          "calibration": main["calibration"], "ks_d": ks_d, "n_reject": sum(1 for r in results if np.isfinite(r["p"]) and r["p"] < alpha)}
values.update({f"n[{lv}]": int(len(x)) for lv, x in zip(levels, groups)})
if test == "all":
    values.update({f"stat[{r['test']}]": r["statistic"] for r in results})
    values.update({f"p[{r['test']}]": r["p"] for r in results})
differ = main["p"] < alpha
verdict = "differ" if differ else "show no evidence of differing"
summary = (f"{main['label']}: statistic = {main['statistic']:.4g}, {cs.fmt_p(main['p'])} ({main['calibration']}"
           + (f", {reps} permutations, seed {seed}" if main["calibration"] == "permutation" else "") + f"). The distributions of {y} across {g} {verdict}.")
if k == 2:
    summary += f" The largest gap between the two ECDFs is D = {ks_d:.3f}"
    if sesoi is not None:
        summary += f" — {'beyond' if ks_d > sesoi else 'within'} the smallest difference of interest ({sesoi:g})."
    else:
        summary += "."
if test == "all":
    summary += f" {values['n_reject']} of {len(results)} tests reject at α = .05."
rows = [{"test": r["label"], "statistic": r["statistic"], "df": r["df"], "p": r["p"], "calibration": r["calibration"]} for r in results]
notes = ["Distribution tests compare whole distributions, not just centers: a small p says the shapes, spreads or locations differ somewhere."]
if any(r["calibration"] == "permutation" for r in results):
    notes.append(f"Permutation p-values relabel the pooled values {reps} times (seed {seed}); the smallest possible p is 1/{reps + 1}.")
if lead == "runs" and main["extra"].get("ties_between"):
    warnings.append(f"{main['extra']['ties_between']} tied value(s) occur in both groups; runs were counted with the tied values arranged to give the most runs (conservative).")
if lead == "ks" and main["calibration"] == "exact" and len(np.unique(np.concatenate(groups))) < values["n"]:
    notes.append("Ties: the exact p is computed conditionally on the tied values (the bound is checked only where the pooled sample changes value).")
cs.publish({
    "method": "distribution.compare",
    "methodVersion": "1.0.1",
    "title": f"Distribution comparison — {main['label']}",
    "engine": cs.engine_info("pandas", "numpy", "scipy"),
    "n": values["n"],
    "summary": summary,
    "apa": f"{main['label']} test, statistic = {main['statistic']:.2f}, {cs.fmt_p(main['p'])}" + (f", D = {ks_d:.2f}" if k == 2 else ""),
    "statistics": [{"key": "statistic", "label": "Statistic", "value": main["statistic"]}, {"key": "p", "label": "p", "value": main["p"]}]
                  + ([{"key": "ks_d", "label": "KS D", "value": ks_d}] if k == 2 else []),
    "tables": [
        {"key": "tests", "title": "Distribution tests", "columns": [
            {"key": "test", "label": "Test", "type": "string"}, {"key": "statistic", "label": "Statistic", "type": "number"},
            {"key": "df", "label": "df", "type": "number"}, {"key": "p", "label": "p", "type": "pvalue"},
            {"key": "calibration", "label": "p-value from", "type": "string"}], "rows": rows},
        {"key": "groups", "title": "Groups", "columns": [
            {"key": "group", "label": g, "type": "string"}, {"key": "n", "label": "n", "type": "integer"},
            {"key": "median", "label": "Median", "type": "number"}, {"key": "iqr", "label": "IQR", "type": "number"}],
         "rows": [{"group": lv, "n": int(len(x)), "median": float(np.median(x)), "iqr": float(np.subtract(*np.quantile(x, [0.75, 0.25])))} for lv, x in zip(levels, groups)]},
    ],
    "effectSizes": [{"key": "ks_d", "label": "Kolmogorov–Smirnov D (largest ECDF gap)", "value": ks_d, "method": "max |F₁ − F₂|"}] if k == 2 else [],
    "assumptions": [{"key": "independence", "label": "Independent groups", "status": "info", "detail": "Each value belongs to one group and the groups are sampled independently."}],
    "warnings": warnings,
    "notes": notes,
    "charts": [cs.chart("ecdf", "ecdf", f"ECDFs of {y} by {g}", {"x": cs.col(y, df[y]), "group": cs.col(g, df[g].astype(str), levels=levels)})],
    "values": values,
})
R

The exact script CodeSplash ran for example “Auto three shapes” · R version 4.5.1 (2025-06-13)

# Compare distributions (two or more groups)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method distribution.compare 1.0.1 · spec 3c10bdb2287603d4
# Dataset: h_shift (version 1)
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.

# %% Setup
library(codesplashr)

# %% Data
df <- as.data.frame(nanoparquet::read_parquet("tests/parity/fixtures/h_shift.parquet", col_select = c("value", "group")))
n_input <- nrow(df)
df[["group"]] <- factor(df[["group"]], levels = c("A", "B", "C"))  # stored level order
df <- df[stats::complete.cases(df[c("value", "group")]), , drop = FALSE]  # listwise deletion
df[] <- lapply(df, function(x) if (is.factor(x)) droplevels(x) else x)
n_dropped <- n_input - nrow(df)
warnings <- list()
if (n_dropped > 0) {
  warnings <- c(warnings, cs_warning("CS_W_ROWS_DROPPED", dropped = n_dropped, total = n_input))
}
if (n_input > 0 && nrow(df) == 0) cs_error("CS_E_NO_ROWS")
cs_check_finite_columns(df, c("value", "group"))  # infinite values stop the run (registry/errors.yaml)

# %% Test
y <- "value"
g <- "group"
present <- Filter(function(lv) any(df[[g]] == lv), levels(df[[g]]))
levels_g <- as.character(present)
groups <- lapply(present, function(lv) as.numeric(df[[y]][df[[g]] == lv]))
k <- length(groups)
test <- "auto"
alternative <- "two.sided"
calibration <- "auto"
seed <- 42  # permutations relabel the pooled sample with the shared Wichmann-Hill stream
reps <- as.integer(499)
sesoi <- NULL
alpha <- 0.05
two_only <- c("ks", "cvm", "bws", "es", "lepage", "cucconi", "runs")
labels_t <- c(ks = "Kolmogorov–Smirnov", ad = "Anderson–Darling k-sample", cvm = "Cramér–von Mises",
              bws = "Baumgartner–Weiß–Schindler", es = "Epps–Singleton", lepage = "Lepage (location and scale)",
              cucconi = "Cucconi (location and scale)", runs = "Wald–Wolfowitz runs")
if (k < 2) cs_error("CS_E_TOO_FEW_GROUPS", column = g, min = 2, k = k)
lead <- if (test %in% c("auto", "all")) (if (k == 2) "ks" else "ad") else test
if (k != 2 && lead %in% two_only) stop(sprintf("The %s test compares two groups; %s has %d. Use Anderson–Darling k-sample.", labels_t[[lead]], g, k))
names_t <- c(lead, if (test == "all") Filter(function(t) t != lead && (k == 2 || !(t %in% two_only)), cs_compare_test_names()) else character(0))
results <- lapply(names_t, function(t) cs_compare_test(groups, t, alternative = if (t == "ks") alternative else "two.sided",
                                                      calibration = calibration, reps = reps, seed = seed))
main <- results[[1]]
ks_d <- if (k == 2) cs_compare_test(groups, "ks")$statistic else NaN

# %% Result
n_all <- sum(vapply(groups, length, numeric(1)))
n_reject <- sum(vapply(results, function(r) is.finite(r$p) && r$p < alpha, logical(1)))
values <- list(n = n_all, groups = k, test = lead, statistic = main$statistic, p = main$p, calibration = main$calibration,
               ks_d = ks_d, n_reject = n_reject)
for (i in seq_len(k)) values[[sprintf("n[%s]", levels_g[i])]] <- length(groups[[i]])
if (test == "all") {
  for (r in results) values[[sprintf("stat[%s]", r$test)]] <- r$statistic
  for (r in results) values[[sprintf("p[%s]", r$test)]] <- r$p
}
verdict <- if (main$p < alpha) "differ" else "show no evidence of differing"
summary <- sprintf("%s: statistic = %s, %s (%s%s). The distributions of %s across %s %s.", main$label, formatC(main$statistic, digits = 4, format = "g"),
                   cs_fmt_p(main$p), main$calibration, if (main$calibration == "permutation") sprintf(", %d permutations, seed %d", reps, as.integer(seed)) else "",
                   y, g, verdict)
if (k == 2) {
  summary <- paste0(summary, sprintf(" The largest gap between the two ECDFs is D = %.3f", ks_d),
                    if (!is.null(sesoi)) sprintf(" — %s the smallest difference of interest (%s).", if (ks_d > sesoi) "beyond" else "within", format(sesoi)) else ".")
}
if (test == "all") summary <- paste0(summary, sprintf(" %d of %d tests reject at α = .05.", n_reject, length(results)))
rows <- lapply(results, function(r) list(test = r$label, statistic = r$statistic, df = r$df, p = r$p, calibration = r$calibration))
notes <- list("Distribution tests compare whole distributions, not just centers: a small p says the shapes, spreads or locations differ somewhere.")
if (any(vapply(results, function(r) r$calibration == "permutation", logical(1)))) {
  notes[[length(notes) + 1]] <- sprintf("Permutation p-values relabel the pooled values %d times (seed %d); the smallest possible p is 1/%d.", reps, as.integer(seed), reps + 1)
}
if (lead == "runs" && isTRUE(main$extra$ties_between > 0)) {
  warnings <- c(warnings, sprintf("%d tied value(s) occur in both groups; runs were counted with the tied values arranged to give the most runs (conservative).", as.integer(main$extra$ties_between)))
}
if (lead == "ks" && main$calibration == "exact" && length(unique(unlist(groups))) < n_all) {
  notes[[length(notes) + 1]] <- "Ties: the exact p is computed conditionally on the tied values (the bound is checked only where the pooled sample changes value)."
}
q <- function(x, p) stats::quantile(x, p, names = FALSE, type = 7)
cs_publish(list(
  method = "distribution.compare",
  methodVersion = "1.0.1",
  title = paste("Distribution comparison —", main$label),
  engine = cs_engine_info("stats", "nanoparquet"),
  n = n_all,
  summary = summary,
  apa = paste0(sprintf("%s test, statistic = %.2f, %s", main$label, main$statistic, cs_fmt_p(main$p)), if (k == 2) sprintf(", D = %.2f", ks_d) else ""),
  statistics = c(list(list(key = "statistic", label = "Statistic", value = main$statistic), list(key = "p", label = "p", value = main$p)),
                 if (k == 2) list(list(key = "ks_d", label = "KS D", value = ks_d)) else list()),
  tables = list(
    list(key = "tests", title = "Distribution tests", columns = list(
      list(key = "test", label = "Test", type = "string"), list(key = "statistic", label = "Statistic", type = "number"),
      list(key = "df", label = "df", type = "number"), list(key = "p", label = "p", type = "pvalue"),
      list(key = "calibration", label = "p-value from", type = "string")), rows = rows),
    list(key = "groups", title = "Groups", columns = list(
      list(key = "group", label = g, type = "string"), list(key = "n", label = "n", type = "integer"),
      list(key = "median", label = "Median", type = "number"), list(key = "iqr", label = "IQR", type = "number")),
      rows = lapply(seq_len(k), function(i) list(group = levels_g[i], n = length(groups[[i]]), median = stats::median(groups[[i]]),
                                                 iqr = q(groups[[i]], 0.75) - q(groups[[i]], 0.25))))
  ),
  effectSizes = if (k == 2) list(list(key = "ks_d", label = "Kolmogorov–Smirnov D (largest ECDF gap)", value = ks_d, method = "max |F₁ − F₂|")) else list(),
  assumptions = list(list(key = "independence", label = "Independent groups", status = "info", detail = "Each value belongs to one group and the groups are sampled independently.")),
  warnings = warnings,
  notes = notes,
  charts = list(cs_chart("ecdf", "ecdf", sprintf("ECDFs of %s by %s", y, g), list(x = cs_col(y, df[[y]]), group = cs_col(g, as.character(df[[g]]), levels = levels_g)))),
  values = values
))

Sources

  • Smirnov, N. V. (1939). Estimate of deviation between empirical distribution functions in two independent samples. Bulletin of Moscow University, 2, 3–16.
  • Hodges, J. L. (1958). The significance probability of the Smirnov two-sample test. Arkiv för Matematik, 3, 469–486.
  • Scholz, F. W., & Stephens, M. A. (1987). K-sample Anderson–Darling tests. Journal of the American Statistical Association, 82, 918–924.
  • Anderson, T. W. (1962). On the distribution of the two-sample Cramér–von Mises criterion. Annals of Mathematical Statistics, 33, 1148–1159.
  • Baumgartner, W., Weiß, P., & Schindler, H. (1998). A nonparametric test for the general two-sample problem. Biometrics, 54, 1129–1135.
  • Epps, T. W., & Singleton, K. J. (1986). An omnibus test for the two-sample problem using the empirical characteristic function. Journal of Statistical Computation and Simulation, 26, 177–203.
  • Lepage, Y. (1971). A combination of Wilcoxon's and Ansari–Bradley's statistics. Biometrika, 58, 213–217.
  • Cucconi, O. (1968). Un nuovo test non parametrico per il confronto tra due gruppi campionari. Giornale degli Economisti, 27, 225–248.
  • Wald, A., & Wolfowitz, J. (1940). On a test whether two samples are from the same population. Annals of Mathematical Statistics, 11, 147–162.

From the CodeSplash method registry · distribution.compare v1.0.1.