Permutation test to compare variability within and distance