PCA for stock analysis I'm working to understand the relationship between the weekly return of a stock and a set of productive factors through time. As productive factors, I'm considering weekly returns on the price of energy variables (oil, natural gas,etc), metals (iron ore, tin, etc), agro (wheat, corn, soy,...), freight costs, labor indicators, and interest rates.
I'm currently working with PCA in R, and I'm trying to figure out if I can use it to detect which factors are more relevant to analyse a given stock.
My matrix is composed of the weekly return of a given stock (say, Apple) and all those productive factors. How can I use the contribution of variables to the main PCs as a reference of which variables are more relevant to the analysis of the stock?
Thanks!

Each principal component can be written as linear combinations of the initial factors. Thus, you could focus on the components that explain most of the variance and look at the coefficient in front of each features in the linear combination. This would be a good indication on how important are the variables in your analysis.
Example: let's say your first component explains 70% of the variance. If $PC1 = 2f_1 + 5f_2$ => $f_2$ would be relevant since it highly contributes to explain the variability of your stock.
