Modeling and evaluation
For the modeling process, we will follow the following steps:
- Extract the components and determine the number to retain
- Rotate the retained components
- Interpret the rotated solution
- Create the factor scores
- Use the scores as input variables for regression analysis
There are many different ways and packages to conduct PCA in R, including what seems to be the most commonly used prcomp()
and princomp()
functions in base R. However, for my money, it seems that the psych
package is the most flexible with the best options. For rotation with this package, you will also need to load GPArotation
.
Component extraction
To extract the components with the psych
package, you will use the principal()
function. The syntax will include the data ...
Get R: Unleash Machine Learning Techniques now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.