Orthoblique rotation on eigenvectors (SAS VARCLUS)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Orthoblique rotation on eigenvectors (SAS VARCLUS)

Axel Urbiz
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]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Orthoblique rotation on eigenvectors (SAS VARCLUS)

Frank Harrell
See the varclus function in the Hmisc package.
Frank

Axel Urbiz wrote
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]]

______________________________________________
[hidden email] 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.
Frank Harrell
Department of Biostatistics, Vanderbilt University
Reply | Threaded
Open this post in threaded view
|

Re: Orthoblique rotation on eigenvectors (SAS VARCLUS)

larrydag
I really like your varclus function Frank.  I have a question about the quartimax rotation of the 1st two eigen vectors as the SAS VARCLUS algorithm dictates.  According to the SAS user guide example of VARCLUS the only thing needed to perform the cluster analysis is the variable correlation matrix.  Is that the case?  The following is the SAS user guide example website.

http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_varclus_sect020.htm

Larry