# how to calculate observation within and between groups variances of PCA scores

I'm kind of new here, and also not a professional statistics guy, so sorry if the answer is obvious and I'm missing something, but I looked everywhere and couldn't figure it out.

I'm doing geometric morphometrics on 52 lithic artifacts. All the artifacts are of the same type but they come from the different sites (site A - 18 items, site B - 19, site C - 15). For each artifact I have a vector of 180 variables (namely 60 3D homologous landmarks).

I've run generalized Procrustes analysis GPA for scaling of the data and superimposition. Next, I use the superimposed coordinates in a principal component analysis (PCA). I get 51 principal components, the first 8 of which explain some 79% of the variance.

I understand that each of these components represents a shape trend (a prototypical shape), that is, a set of landmarks are linked and change together. The score of each artifact on each component represents a relative location on that trend. I can also draw a scatter plot of the first 2 components, which explain almost 50% of the variance and marks the artifacts from the different sites in different colors.

However, I would like to know the variance for each of these groups.

I know that if I calculate the variance of the entire sample, I get the eigenvalues each component, but is it correct to use the eigenvalues to calculate separate variances of the different groups?

If so, is there a multivariate method to combine (add?) all the variances of a single group to understand in general terms how variable is that group of artifacts in terms of shape?

Finally, is there a way to test whether differences in variances of the different groups are significant? Should I use LDA for that, and if so, should I use the original data or the PC scores?

## 1 Answer

You want the Procrustes variance, also called 'morphological disparity' in geometric morphometrics. You can compute Procrustes variances and test for significant differences among groups using the morphol.disparity function in the R package geomorph. The documentation for this function provides a mathematical definition of morphological disparity:

Morphological disparity is estimated as the Procrustes variance, overall or for groups, using residuals of a linear model fit. Procrustes variance is the same sum of the diagonal elements of the group covariance matrix divided by the number of observations in the group (e.g., Zelditch et al. 2012).

The significance test implemented here is based on permutations of vectors of residuals across groups.

References

Adams, D.C., and E. Otarola-Castillo. 2013. geomorph: an R package for the collection and analysis of geometric morphometric shape data. Methods in Ecology and Evolution. 4:393-399.

Zelditch, M. L., D. L. Swiderski, H. D. Sheets, and W. L. Fink. 2012. Geometric morphometrics for biologists: a primer. 2nd edition. Elsevier/Academic Press, Amsterdam.