Lepage's test combines the Wilcoxon rank-sum and the Ansari–Bradley statistics. We propose to replace the latter statistic by a Wilcoxon rank-sum calculated after Levene's transformation. We use the medians for this transformation, i.e. absolute deviations from sample medians are calculated. The new location–scale test can be carried out as a permutation test based on permutations of the original observations, the Levene transformation has to be applied for each permutation in an intermediate step to calculate the test statistic. Simulations indicate that the new test can be more powerful than an O'Brien-type test and Lepage's test, the latter is the standard nonparametric location–scale test. The new test is illustrated using real data about colony sizes of yellow-eyed penguins and an SAS program to perform the test is freely available.