주요 콘텐츠

rotatefactors

Rotate factor loadings

Description

B = rotatefactors(X) returns a rotated version of the loadings matrix X that maximizes the varimax criterion.

example

B = rotatefactors(X,Name=Value) specifies additional options using one or more name-value arguments. For example, you can specify the method for computing the rotated factor loadings.

example

[B,T] = rotatefactors(___) additionally returns the rotation matrix T, where B = X*T, using any of the input argument combinations in the previous syntaxes.

Examples

collapse all

Load the hald data set, which measures the effect of cement composition on its hardening heat.

load hald

The matrix ingredients contains the percent composition of four chemicals present in the cement. Use the pca function to find the two principal components with the highest variance for the ingredients data.

X = pca(ingredients,NumComponents=2)
X = 4×2

   -0.0678   -0.6460
   -0.6785   -0.0200
    0.0290    0.7553
    0.7309   -0.1085

X contains the factor loadings for the four chemicals.

Find a rotated version of X by using the rotatefactors function.

B = rotatefactors(X)
B = 4×2

   -0.0253   -0.6491
   -0.6757   -0.0645
   -0.0206    0.7556
    0.7364   -0.0603

By default, the rotatefactors function maximizes the varimax criterion to find the rotated factor loadings B.

Load the hald data set, which measures the effect of cement composition on its hardening heat.

load carbig

Define the variable matrix and remove observations with missing values.

cardata = [Acceleration Displacement Horsepower MPG Weight]; 
cardata = cardata(all(~isnan(cardata),2),:);

Estimate the factor loadings using a minimum mean squared error prediction for a factor analysis with two common factors. Do not rotate the factor loadings.

[Lambda,Psi,T,~,F] = factoran(cardata,2,Rotate="none");

Rotate the factors using the orthomax method.

rotatedLambda = rotatefactors(Lambda,Method="orthomax");

Plot the unrotated and rotated factor loadings.

grid on
biplot(Lambda,LineWidth=2,MarkerSize=20)
hold on
biplot(rotatedLambda,LineWidth=2,MarkerSize=20,Color="red")
legend(["Unrotated" "" "" "Rotated"])
hold off

Figure contains an axes object. The axes object with xlabel Component 1, ylabel Component 2 contains 5 objects of type line. One or more of the lines displays its values using only markers These objects represent Unrotated, Rotated.

Input Arguments

collapse all

Factor loadings, specified as a d-by-m numeric matrix, where d is the number of variables and m is the number of factors. X usually contains principal component coefficients computed using pca or pcacov, or factor loadings estimated using factoran.

Data Types: single | double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: B = rotatefactors(X,Method="orthomax",Coeff=2) returns a rotated version of the factor loadings X that maximizes the orthomax criterion with a coefficient value of 2.

Rotation method, specified as a value in the following table. You can set the additional name-value arguments shown for the specified method.

ValueDescriptionAdditional Name-Value Arguments

"orthomax"

Orthogonal rotation of X that maximizes the criterion sum(d*sum(B.^4,1) – g*sum(B.^2,1).^2), where d is the number of rows (variables) in X, and g is the value of Coeff

Coeff, Normalize, RelTol, MaxIt

"varimax" (Default)

Orthomax rotation of X where g=1

Normalize, RelTol, MaxIt

"equamax"

Orthomax rotation of X where g=m/2 and m is the number of columns (factors) in X

Normalize, RelTol, MaxIt

"parsimax"

Orthomax rotation of X where g=d*(m – 1)/(d +m – 2)

Normalize, RelTol, MaxIt

"quartimax"

Orthomax rotation of X where g=0

Normalize, RelTol, MaxIt

"pattern"

Oblique rotation (the default) or an orthogonal rotation of X that best matches the pattern matrix Target

Target (required), Type

"procrustes"

Oblique rotation (the default) or an orthogonal rotation of X that best matches the pattern matrix Target according to least squares

Target(required), Type

"promax"

Oblique Procrustes rotation of X that best matches a target matrix determined by factoran as a function of an orthomax solution with g=Coeff

Coeff, Normalize, RelTol, MaxIt, Power

Example: Method="orthomax"

Data Types: char | string

Flag to row-normalize the factor loadings, specified as "on" or "off", or as a logical 0 (false) or 1 (true). The function ignores the value of Normalize when Method is "procrustes" or "pattern". For all other methods, when Normalize is "on" (the default), rotatefactors normalizes each row of X to have a unit Euclidean norm prior to rotation, and unnormalizes the rows after rotation.

Example: Normalize="off"

Data Types: char | string | logical

Relative convergence tolerance used to find the rotation matrix T, specified as a positive numeric scalar. rotatefactors ignores the value of RelTol when Method is "procrustes" or "pattern".

Example: RelTol=1e-12

Data Types: single | double

Maximum number of iterations used to find the rotation matrix T, specified as a positive integer. rotatefactors ignores the value of MaxIt when Method is "procrustes" or "pattern".

Example: MaxIt=100

Data Types: single | double

Rotation coefficient, specified as a numeric scalar. When Method is "orthomax", the function finds a rotation that minimizes sum(d*sum(B.^k,1) – Coeff*sum(B.^2,1).^2), where k=4. When Method is "promax", k equals the value of Power. For all other methods, rotatefactors ignores the value of Coeff.

Example: Coeff=2.5

Data Types: single | double

Exponent for creating the target matrix when Method is "promax", specified as a numeric scalar greater than 1. For all other methods, rotatefactors ignores the value of Power.

Example: Power=3

Data Types: single | double

Target matrix, specified as a numeric matrix with the same dimensions as X. When Method is "procrustes", the function performs an oblique Procrustes rotation of X to the target loadings matrix Target. When Method is "pattern", the function performs an oblique or orthogonal rotation of X to the pattern matrix Target.

Specify Type to choose the type of rotation. If Type="oblique" (the default), each column of Target must contain at least m – 1 zeros, where m is the number of columns (factors) in X. If Type="orthogonal", the jth column of Target must contain at least mj zeros.

The pattern matrix Target defines the restricted elements of the rotated factor loadings B. That is, the elements of B that correspond to zero elements of the pattern matrix are constrained to have small magnitude, whereas the elements of B that correspond to nonzero elements of Target can have any magnitude.

For all other methods, rotatefactors ignores the value of Target.

Example: Target=[2 4; 2 1; 5 6]

Data Types: single | double

Type of rotation, specified as "oblique" or "orthogonal". This argument is valid only when Method is "procrustes" or "pattern".

If Type is "orthogonal", the rotation is orthogonal, and the factors remain uncorrelated.

If Type is "oblique" (the default), the rotation is oblique, and the rotated factors might be correlated.

For all other methods, rotatefactors ignores the value of Type and performs an orthogonal rotation.

Example: Type="orthogonal"

Data Types: char | string

Output Arguments

collapse all

Rotated factor loadings, returned as a numeric matrix.

Rotation matrix, returned as a numeric matrix T where B = X*T. You can compute the correlation matrix of the rotated factor loadings using C = inv(T'*T). For orthogonal rotation, C is the identity matrix. For oblique rotation, C has unit diagonal elements but nonzero off-diagonal elements.

References

[1] Harman, Harry Horace. Modern Factor Analysis. 3rd Ed. Chicago: University of Chicago Press, 1976.

[2] Lawley, D. N., and A. E. Maxwell. Factor Analysis as a Statistical Method. 2nd Ed. New York: American Elsevier Publishing Co., 1971.

Version History

Introduced before R2006a