How to use this calculator
Test a difference in means by enumerating every allocation of pooled values to two independent groups of the observed sizes.
- Enter Group A values, Group B values. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Exact independent sample mean permutation test explained
The exact randomization test holds the two sample sizes fixed and enumerates every allocation of the pooled observations. Its two-sided p-value counts allocations whose absolute mean difference is at least as large as the observed contrast.
Inputs, symbols, and units
x— Group A values- Ordered values in the role named above. Match row positions with other lists and use a consistent measurement unit within the same variable. Use comma-separated values in the stated order.
y— Group B values- Ordered values in the role named above. Match row positions with other lists and use a consistent measurement unit within the same variable. Use comma-separated values in the stated order.
Formula and method
T=mean(A)−mean(B); p=#{allocations with |T*|≥|Tobs|}/C(nA+nB,nA).
Hold group sizes fixed and reassign observation labels through all combinations. Equal values remain distinct observations, so repeated allocations carry their appropriate multiplicity. The two-sided tail is based on absolute mean difference, not doubled one-sided tails.
A worked scenario
Group A values = 4,5,7,8; Group B values = 1,3,4,6.
- Exact absolute-tail permutation p-value: 0.1714285714
- Observed mean difference: 2.5 data units
- Assignments enumerated: 70
Four of eight observations are assigned to A, giving seventy allocations. The observed mean contrast is compared with all seventy, including the original assignment.
Assumptions and edge cases
At least two observations per group and at most 20 combined. Exactness relies on exchangeable labels under the null, such as a randomized experiment; unequal distributions with only equal means need not satisfy it.
Reading the outputs
The first result is the fraction of enumerated assignments as extreme in absolute difference. No simulation seed or Monte Carlo correction is needed.
Frequently asked questions
Why the limit of twenty values?
Enumeration grows combinatorially; the cap keeps computation practical in the browser.
Can this replace a Welch test automatically?
No. Welch targets means under different assumptions; label permutation requires exchangeability.
Do repeated measurements belong here?
Use the paired sign-flip permutation tool when observations are matched.
How do I use the Exact independent sample mean permutation test calculator?
Enter Group A values, Group B values. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Exact independent sample mean permutation test?
Group A values = 4,5,7,8; Group B values = 1,3,4,6. Exact absolute-tail permutation p-value: 0.1714285714 Observed mean difference: 2.5 data units Assignments enumerated: 70 Four of eight observations are assigned to A, giving seventy allocations. The observed mean contrast is compared with all seventy, including the original assignment.
Method reference: SciPy permutation null models; this page states its own absolute-tail convention.
Read our calculation methodology.