# What output from PCA do I use for a Mahalanobis distance analysis?

I am working with dental metric data to perform a biological distance analysis. The standard procedure in my field is to perform a PCA on the cleaned, imputed dataset to reduce correlation and then determine Mahalanobis Distance for each individual in the dataset. I've never done this type of analysis before, and I'm assuming it must be so obvious, because no one really explains how they move from Step 1 to Step 2.

I've completed a PCA using FactoMineR in R on my dataset; I'm keeping the first four principal components, which all have eigenvalues >1 (the standard in my field). However, I don't know what output from the PCA I should keep to run the distance analysis. The PCA function returns 3 values for individuals: coordinates for each dimension, cos2 for each dimension, and contribution for each dimension.

I'm guessing it's coordinates, but I'd rather be sure before I move on.

Yes it is under $ind$coord. You need to subset the columns based on the cut off you defined, for example:
library(FactoMineR)
keep = res.pca$$eig[,1] > 0.5 PCs = res.pca$$ind$coord[,keep]  Not very sure what kind of m you are calculating, but let's say we go for pairwise, using the solution from this post cholMaha <- function(X) { dec <- chol( cov(X) ) tmp <- forwardsolve(t(dec), t(X) ) dist(t(tmp)) } pairwise_Ma = cholMaha(PCs)  And simple cluster: plot(PCs[,1:2],col=factor(kmeans(pairwise_Ma,3)$cluster))