Comparing variability of two groups of multivariate data points I have a number of samples (data points) from two experimental groups, A and B (500 altogether). Each sample corresponds to a large number of variables (genes in my case); together, they form a matrix of $500 \times 40000$. I would like to answer the question, are samples in group A on the general more variable than samples in group B? The biology of the problem suggests that this might be the case (read, this is the hypothesis that I want to test).
I thought I might do the following: for each group, calculate the multivariate center of the group (by taking sample-wise means for each variable, for example), then calculate the euclidean (or some other) distance to the centre for each sample in the group and then the variance of the distance. Then, do the same for the other group. I am well aware that this is a very naive approach.
What would be the advisable approach?
 A: You are on the right track with calculating the distances to the group centers. 
In general, you are looking for a multivariate version of the test for the homogenity of variance (with $H_0$: "Variances are equal across the two groups", which would allow you to reject that the variances are equal). Since you haven't mentioned any assumptions you are allowed to make (like the normality assumption) I will assume the two distributions aren't normal.
The vegan package in R has a function betadispers, which as far as I understand should be exactly what you are looking for, a multivariate version of the Levene's test. The procedure behind the test was developed by M.J. Anderson and is described here.
Last detail, you will have to calculate the distance of your gene observations that are stored as matrices. So you will have to concatenate both of them into two vectors of length (2e7 = 500x40000). Which makes me wonder, is there any particular reason why they were stored as matrices in the first place? Is there perhaps some spatial structure that would get lost during concatenation, which would be potentially important for the variance comparison?
If the structure isn't a problem concatenate ahead!
