factor.rotate.Rd
Given a factor or components matrix, it is sometimes useful to do arbitrary rotations of particular pairs of variables. This supplements the much more powerful rotation package GPArotation and is meant for specific requirements to do unusual rotations.
factor.rotate(f, angle, col1=1, col2=2,plot=FALSE,...)
original loading matrix or a data frame (can be output from a factor analysis function).
angle (in degrees!) to rotate
column in factor matrix defining the first variable
column in factor matrix defining the second variable
plot the original (unrotated) and rotated factors
parameters to pass to fa.plot
Partly meant as a demonstration of how rotation works, factor.rotate is useful for those cases that require specific rotations that are not available in more advanced packages such as GPArotation. If the plot option is set to TRUE, then the original axes are shown as dashed lines.
The rotation is in degrees counter clockwise.
The resulting rotated matrix of loadings.
For a complete rotation package, see GPArotation.
#using the Harman 24 mental tests, rotate the 2nd and 3rd factors 45 degrees
f4<- fa(Harman74.cor$cov,4,rotate="TRUE")
#> Specified rotation not found, rotate='none' used
#> Warning: NaNs produced
f4r45 <- factor.rotate(f4,45,2,3)
f4r90 <- factor.rotate(f4r45,45,2,3)
print(factor.congruence(f4,f4r45),digits=3) #poor congruence with original
#> [,1] [,2] [,3] [,4]
#> MR1 1 0.00 0.00 0
#> MR2 0 0.76 -0.76 0
#> MR3 0 0.65 0.65 0
#> MR4 0 0.00 0.00 1
print(factor.congruence(f4,f4r90),digits=3) #factor 2 and 3 have been exchanged and 3 flipped
#> [,1] [,2] [,3] [,4]
#> MR1 1 0 0 0
#> MR2 0 0 -1 0
#> MR3 0 1 0 0
#> MR4 0 0 0 1
#a graphic example
data(Harman23.cor)
f2 <- fa(Harman23.cor$cov,2,rotate="none")
op <- par(mfrow=c(1,2))
cluster.plot(f2,xlim=c(-1,1),ylim=c(-1,1),title="Unrotated ")
f2r <- factor.rotate(f2,-33,plot=TRUE,xlim=c(-1,1),ylim=c(-1,1),title="rotated -33 degrees")
op <- par(mfrow=c(1,1))