[R] Orthoblique rotation on eigenvectors (SAS VARCLUS)

From: Axel Urbiz <axel.urbiz_at_gmail.com>
Date: Sat, 09 Apr 2011 12:17:52 -0400


Hi All,

I'd like to build a package for the community that replicates the output produced by SAS "proc varclus". According to the SAS documentation, the first few steps are:

  1. Find the first two principal components.
  2. Perform an orthoblique rotation (quartimax rotation) on eigenvectors.
  3. Assign each variable to the rotated component with which it has the higher squared correlation. The cartoon example below attempt to do this, but I found my results differ from SAS in "pc3" (i.e, the standardize component scores).

I'd appreciate your help in whether you see anything wrong in "pc2" or "pc3"?

set.seed(1)
x1=rnorm(200); x2=0.9*x1; x3=0.7*x1; x4=x1*x1; x5=x1*x1*x1;
x6=rnorm(200); x7=0.9*x6; x8=0.7*x6; x9=x6*x6; x10=x6*x6*x6;
x <- cbind(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10)

require(GPArotation)

pc1 <- princomp(x, cor = TRUE, scores = TRUE)
pc2 <- quartimax(pc1$loadings[,1:2],normalize=TRUE)$loadings
pc3 <- scale(x%*% pc2)
pc4 <- apply(x, 2, function(x) cor(x, pc3)^2)

Thanks in advance for any help!

Axel.

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 09 Apr 2011 - 16:22:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 10 Apr 2011 - 17:10:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive