I have to do a PCA in R for a project, but I have 300 data in 15 differents groups, and I want to find the reduced space which gives me the most variability between the groups and cluster my data in their own group ( so not between all the data) so I can do an analysis later while using these variables (I have 4000 very similar variables).
I know how to do the analysis when I want to cluster data that are not already in a group, but I don't know how to do it when I want to find out which variable can separate my groups the best.
The objective is that I use the reduced space that explain the most of the group variability to use them to do analysis, to observe if the data groups are really significantly different when I consider all the data, but I'm not sure if it's actually something possible to do with a ACP.
Thank you!