Dana,
While your data analysis seems like a trajectory analysis, it’s not in the strictest sense, as points in each of the trajectories are shared among groups. There is no good way to handle this with the trajectory.analysis function. But don’t despair, you actually have a very good option at your disposal.
The advanced.procD.lm function does a lot of things, but most importantly, it provides the tools to do almost anything. I like to consider your analysis a second-order analysis. A first-order analysis is one that asks, e.g., are means different? A second-order analysis is one that asks, e.g., if pairs of differences in means are different? In order to do a second-order analysis, one must be able to work with the means from random permutations. advanced.procD.lm allows one to do that.
In advanced.procD.lm, there are two types of output available: random.LS.means and random.LS.means.dist. The former are the random means generated, the latter the distances (differences) in vector lengths among them. The latter would allow one to contrast differences in vector lengths, for example. I’ll assume for the moment that this is your purpose. Below is an example, using the geomorph plethodon data and only a few random permutations. You could adapt this to your data and use more permutations, to construct a formal test. (You might also play around with examples in the help file to become more familiar with the function.)
Hope this was helpful!
Mike
library(geomorph)
data(plethodon)
Y.gpa<-gpagen(plethodon$land)
gdf <- geomorph.data.frame(Y.gpa, species = plethodon$species, site = plethodon$site)
apd <- advanced.procD.lm(coords~species*site, ~1,
groups = ~species*site, data = gdf, iter = 9) # small number of permutations just for example
apd # standard results
apd$LS.means # just the means
apd$LS.means.dist # distance matrix among means
apd$random.means.dist # all random outcomes. This is the important part!
# let's compare two vectors 1 = Jord:Allo to Teyah: allo; 2 = Jord:Allo to Jord:Symp
# use absolute value of difference in vector lengths)
abs(apd$LS.means.dist[3,1] - apd$LS.means.dist[2,1]) # observed case
# apply this to all random outcomes
myTest <- function(x) abs(x[3,1]-x[2,1])
myResult <- sapply(apd$random.means.dist, myTest)
myResult # first value is observed case, all other values are random results
# getting a P-value - use rank of observed value - 1 (to count the observed as one
# random case), divided by number of permutations)
1 - (rank(myResult)[1] - 1)/length(myResult)