# 2.6 Test based on medians

Levene’s test (for univariate data) can be made more robust (i.e. less affected by outliers) by using deviations from *medians* rather than deviations from means (
Brown & Forsythe (1974)
,
Conover, Johnson & Johnson (1981)
). However, for multivariate data, there is more than one way to define a median (
Haldane (1948)
,
Gower (1974)
,
Brown (1983)
). One definition of a median for multivariate data is the vector of medians for each individual variable (e.g.,
O’Brien (1992)
,
Manly (1994)
). Another possibility is to invoke a spatial concept for the median as the point in the multivariate cloud which minimises the sum of the distances from each observation to that point, called the ‘mediancentre’ by
Gower (1974)
. This spatial median is invariant to rotational changes in the axes, a quality which is not shared by the vector of medians of individual variables. This invariance to rotation is important for our purposes here, where PCO axes (which can involve rotations of the original data cloud) might be used, so PERMDISP (optionally) uses spatial medians.

An analysis that calculates the *z* values as deviations from spatial medians (rather than centroids) will clearly be less affected by outliers, so will tend to be more robust if the distribution of points in the data cloud is highly skewed for some reason. PERMDISP provides an option to perform the test based on medians rather than centroids: simply choose (Distances are to •Medians) in the PERMDISP dialog box (Fig. 2.4). Note that the residuals which are permuted for the test based on medians are not the least-squares (LS) residuals (as are used for the test on the basis of centroids). Instead, the multivariate analogue of least absolute deviation (LAD) residuals (e.g.,
Cade & Richards (1996)
) are permuted instead. That is, the groups are first centered on to a common spatial median before proceeding with the permutations.

**Relevant aside:** If you have a single variable and the analysis is based on a Euclidean distance matrix, then PERMDISP using centroids and tables will give Levene’s () original univariate test, while PERMDISP using medians and tables will give the modification of Levene’s test proposed by
Brown & Forsythe (1974)
^{54} for univariate data.

**Recommendation:** Simulations with multivariate ecological datasets indicated that the test using PERMDISP on the basis of distances to centroids, with *P*-values obtained using permutations, gave the best overall results (in terms of type I error and power,
Anderson (2006)
). These are thus the default options for the routine.

^{54} The version of Levene’s test used most commonly and available in many statistical computer packages is this version based on medians.