PCA on linguistic variables: How far languages are? I performed principal components analysis on continuous variables describing 16 languages. Using the first two axes, which explain 76% of variance, I need to calculate the distance between each pair of languages as appeared on the first two axes; to test in a Mantel test the correlation between distances in linguistic variables and geographic distances. Could anyone help me: how can I do that?
cheers
 A: I typically use the R package 'vegan', and the function rda() to run PCA. You can extract the PC scores (where the languages fall on the PC axes) pretty simply from that output using scores(), selecting specific PC axes (in your case, just the first two), and then calculate all pairwise distances using the dist() function in the base packages of R. 
Below is a worked example - the following example code uses a sample dataset from 'vegan'. The dataset (dune) is a community ecology dataset. Typically you wouldn't use PCA for that (use other ordinations instead), but it works to demonstrate.
Naturally, the help files for rda(), dist(), and scores() might be helpful, but this code should get you started. (tested in R version 3.0.2, and vegan package version 2.0-9)
    #The following code assumes the columns represent the variables [i.e., measures of languages for you, but vegan uses the terminology "species" as it was written for community ecology datasets] and the rows represent observations [i.e., individual languages for you, or "sites" as vegan calls them].
library(vegan) #load necessary package
data(dune) #call data file
pca.dune<-rda(dune) #run the PCA to see specifics - if you just do rda(dune) it will run a PCA using the covariance matrix; to use correlation matrix include the argument "scale=TRUE"
dune.scores<-data.frame(scores(pca.dune, choices=c(1:2), display="sites")) #extract the scores for PC1 and PC2 for each data row [i.e., language in your case, represented by "sites"]
dune.scores #take a look at it if you want.
dune.dist<-dist(dune.scores, method="euclidean", diag=TRUE) #Calculates Euclidean distances using dist() in the base packages of R. vegdist() is another command for computing distances, based in vegan, which has some more options for types of distances
dune.dist #View distance matrix

With the final (PC) distance matrix, I think you should be able to line it up with your geographic distance matrix to run further analyses.
I hope that helps!
