Statistics & probability

PERMDISP multivariate dispersion test calculator with group spatial medians

Keep the distance matrix and group labels in the same observation order.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Keep the distance matrix and group labels in the same observation order. This bounded version requires a Euclidean-embeddable matrix.

THE FORMULAzᵢ=||uᵢ−median(groupᵢ)||; F=[SSbetween/(g−1)]/[SSwithin/(n−g)].

A worked example

Both spatial medians are (0,0). Distances are [2,1,2,1] and [4,2,4,2], means1.5 and3; F=5.4, df1=1,df2=6. Equal spread gives F=0.

Good to know

8–60 observations; 2–6 groups with at least 3 each; Euclidean-embeddable distances only (reject materially negative Gram eigenvalues); Weiszfeld median convergence diagnostics; 999–4999 residual permutations, 20 million work cap. Report median rather than anti-conservative centroid permutation convention. Full-model residual permutations are used; zero-denominator positive-between null statistics count as infinite extremes.

Supply distances and group membership together

Keep the distance matrix and group labels in the same observation order. This bounded version requires a Euclidean-embeddable matrix.

Groups describe independent sampling units. A distance matrix computed from repeated measurements does not remove their dependence.

Mean distance to spatial medianMean distance to spatial medianGroup 01.5Group 13Same center, twice the mean distance: 1.5 versus 3; F=5.4.
Scroll across to see the full diagram.
Same center, twice the mean distance: 1.5 versus 3; F=5.4.

Compare this with the One factor PERMANOVA calculator from a distance matrix. Test differences in spread by distances to group spatial medians in principal-coordinate space, followed by residual-permutation F inference. Existing PERMANOVA tests pseudo-F location/dispersion jointly and explicitly offers no dispersion test.

Distinguish spread from separation

PERMDISP asks whether average distance from the group center differs across groups. The center is the spatial median in coordinate space.

Two clouds may share the same center and have very different radii. Conversely, widely separated clouds can have identical within-group dispersion. The eight default points form two crosses with the same center. One group has radii2,1,2,1 and the other4,2,4,2. Their mean distances to the spatial median are1.5 and3. The between-group sum of squares is4.5, while the within-group sum is5, giving F=(4.5/1)/(5/6)=5.4. Because both centers are the origin, this example isolates spread without a group-location shift. Translation of every point by the same vector must leave all distances and the test statistic unchanged. This makes the translated reference case a useful check on the entire principal-coordinate pipeline.

Reconstruct coordinates and retain the geometry

Double-center squared distances, inspect eigenvalues and recover principal coordinates. Material negative eigenvalues fall outside this Euclidean-only version.

Find each group spatial median before computing distances. A centroid can be pulled by extreme rows and has different permutation behavior.

Work through the checked default example

Both spatial medians are (0,0). Distances are [2,1,2,1] and [4,2,4,2], means1.5 and3; F=5.4, df1=1,df2=6. Equal spread gives F=0.

The between-group distance sum of squares is 4.5 and residual sum is 5 with six residual degrees of freedom. F is 5.4; complete residual allocation gives p=2/70, while the parametric F reference is about 0.0591413. A supplied distance matrix is centered into its Gram matrix before eigendecomposition. Material negative eigenvalues mean these distances cannot be embedded in ordinary Euclidean coordinates under the selected convention, so the page rejects them. It does not silently discard substantial negative axes and thereby change the geometry. The spatial median minimizes total distance rather than squared distance. A modified Weiszfeld iteration handles a candidate median coinciding with an observation; the ordinary inverse-distance update would divide by zero there. Repeated points are therefore not automatically invalid, but completely zero distance variation gives no meaningful dispersion test.

Permute full-model residual distances

Regress the distances on the group indicators and subtract each group mean. Shuffle those residuals globally while leaving the design fixed.

Fit the shuffled residuals to the same group design and recompute F. Adding the original fitted group differences would preserve the alternative being tested.

Read mean distances and F together

Mean distances remain in the original distance units. F compares between-group differences against residual variation in those distances.

Permutation inference compares the observed F with a simulated residual null. The ordinary F-distribution probability is a separate reference and may differ. The permutation implementation follows full-model residual permutation: subtract each group's fitted mean distance, globally permute those residuals, and fit them to the unchanged group design. Do not restore the original group means after shuffling; that would preserve the observed spread difference in the null samples. A permutation can have positive between-group variation and zero residual variation, giving an infinite F that counts as extreme. The original observed F still needs a defined residual denominator. The default's exhaustive reference p is2/70, whereas the displayed seeded Monte Carlo p may differ. A parametric F-tail probability is a different calculation and must not be substituted for that permutation result.

Use this alongside a location comparison

PERMANOVA can respond to location or dispersion. A dispersion analysis helps describe that ambiguity but cannot automatically correct another test.

Preserve the distance definition and any feature scaling with the result. Standardizing features changes the geometry and potentially the conclusion. The plot uses the fixed default configuration, not an updated projection of newly entered dissimilarities. For another dataset, use the returned distances and mean dispersions to interpret its result. The number of retained positive principal-coordinate axes can exceed two even though a two-dimensional illustration is shown. A planar picture therefore cannot replace the full distance-based statistic or diagnose every high-dimensional feature.

A few questions, answered

Is this another PERMANOVA?

No. It analyzes distances to group spatial medians and tests spread, rather than the original between-group dissimilarity partition.

Why reject negative coordinate eigenvalues?

The bounded implementation uses real Euclidean geometry only. It does not silently replace negative contributions or add an undocumented correction.

Are group labels shuffled?

The reference procedure shuffles residuals from the full distance-on-group model, then regresses those shuffled residuals on the fixed groups.

Can I choose a centroid instead?

This page fixes the spatial-median convention. A centroid analysis has different behavior and should not be substituted without reporting that choice.

Find your calculator

Start typing to explore the library.