Comparing PCA's between groups


I would like to seek advice from the RStudio community. I have tried to google code to help me answer my question but ultimately I'm not sure if it can or should be done.

I have a data set with 11 columns, one column for ID, one for Sex and one for the number of test (1-4) with the rest of the variables being numeric. I ran my PCA's and was able to generate graphs to show the distribution between sex and number of test. Each individual was tested four times, so there is also repeatability.
I was able to generate the PCA loadings and determine which variables were significant in which PCA.

Output from my PCA showing the results of the first 4 PCA's
SS loadings 4.62 0.98 0.71 0.63
Proportion Var 0.58 0.12 0.09 0.08
Cumulative Var 0.58 0.70 0.79 0.87
Proportion Explained 0.66 0.14 0.10 0.09
Cumulative Proportion 0.66 0.81 0.91 1.00

Graph plotting PCA1 against PCA2 and differentiated between sexes

However, I would like to compare the impact of different factors (Sex or Test number). How would I extract the individual PCs to use in an GLMM for comparison?

Any help or advice would be much appreciated

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.