I’ve done a princomp analysis on four columns of my dataframe, and found that the first component is overwhelmingly more important than the other three.
Now I want to fit a linear model using the first component only. How do I get the new data made up of only this component?
I understand that there’s some matrix multiplication involved, but I have no idea how to do this. I’ve googled and googled and can’t find anything comprehensible.
The scores are the transformed data using the principal components. I think
prcompandprincompyield these as an output. Then just select the first column. Take a look at the documentation ofprincomporprcomp(?prcomp,?princomp), specifically at the Value section (which describes what the function returns) and the examples section.