I am trying to implement PCA for one of the problems.There are two functions in R to do the same:
princomp and prcomp.
While princomp expresses the data in terms of the principal components(-scores) prcomp doesn’t I guess,so:
**Q1.**How do I get the data expressed in terms of the PC’s using prcomp?
**Q2.**Which matrix do I use ultimately,as in the scores or the rotated ones?
After rotation the details look like:
So do I interpret this as: The Comp1 has maximum contribution from Total.Day.Minutes and Total.Day.Charge and hence it can be named something like :Day.Comp and then I use the scores matrix with these names for further analysis??
This ques has risen because of my confusion in how to use the rotated components and scores.
Q3. What does ‘x’ in prcomp return when retx = F?The code:
churn.pca <- prcomp(churn[,5:18],center = T,scale. = T) churn.pca.x <- data.frame(churn.pca$x) # With the option retx = T churn.pca <- prcomp(churn[,5:18],center = T,scale. = T,retx = T) churn.pca.retx <- data.frame(churn.pca$x) sum(which(churn.pca.retx != churn.pca.x))
x with retx = T returns the rotated variables (is this the same as the scores matrix from princomp after rotation).What does x contain when retx = F as
sum(which(churn.pca.retx != churn.pca.x)) came out to be 0.
Can somebody please clarify these to me??