I have $2$ $n\times p$ matrices, where $n$ are the rows (samples), and $p$ the columns (measurements). Each matrix has samples and measurements from different groups. I call these the "raw" data. I've conducted a principal components analyses of the complete raw data, and computed the mean of each PC score by group. The latter I call the mean of the PC scores by group.
My question is whether the means of the PC scores by group (raw-data $\rightarrow$ PCA $\rightarrow$ mean PCs by group) would differ from the PC scores derived from a PCA conducted on the "raw" group means (raw data $\rightarrow$ mean by group $\rightarrow$ PCA)?
Example analysis of simulated data
set.seed(123)
a <- matrix(rnorm(900),ncol=3,byrow=F)
a[1:100,] <- 4 + a[1:100,]
a[101:200,] <- -4 + a[101:200,]
# compute PCA and extract PC scores
pc <- prcomp(a)$x
plot(pc[,1:2],col=rep(c("red","blue","green"),each=100))
# compute PC means and plot
m <-rbind(colMeans(pc[1:100,1:2]),colMeans(pc[101:200,1:2]),colMeans(pc[201:300,1:2]))
points(m,col="black", pch=19,cex=1)
# compute means of raw data by group
b <- rbind(colMeans(a[1:100,]),colMeans(a[101:200,]),colMeans(a[201:300,]))
# conduct PCA on "raw means" and plot
pc2 <- prcomp(b)$x
points(pc2[,1:2],col="black", pch=17,cex=1)