# faMain: Automatic Factor Rotation from Random Configurations with... In fungible: Psychometric Functions from the Waller Lab

## Description

This function conducts factor rotations (using the GPArotation package) from a user-specified number of random (orthogonal) starting configurations. Based on the resulting complexity function value, the function determines the number of local minima and, among these local solutions, will find the "global minimum" (i.e., the minimized complexity value from the finite number of solutions). See Details below for an elaboration on the global minimum. This function can also return bootstrap standard errors of the factor solution.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18``` ```faMain( X = NULL, R = NULL, n = NULL, numFactors = NULL, facMethod = "fals", urLoadings = NULL, rotate = "oblimin", targetMatrix = NULL, bootstrapSE = FALSE, numBoot = 1000, CILevel = 0.95, Seed = 1, digits = NULL, faControl = NULL, rotateControl = NULL, ... ) ```

## Arguments

 `X` (Matrix) A raw data matrix (or data frame). `R` (Matrix) A correlation matrix. `n` (Numeric) Sample size associated with the correlation matrix. Defaults to n = NULL. `numFactors` (Numeric) The number of factors to extract for subsequent rotation. `facMethod` (Character) The method used for factor extraction (`faX`). The supported options are "fals" for unweighted least squares, "faml" for maximum likelihood, "fapa" for iterated principal axis factoring, "faregLS" for regularized least squares, "faregML" for regularized maximum likelihood, and "pca" for principal components analysis. The default method is "fals". "fals": Factors are extracted using the unweighted least squares estimation procedure using the `fals` function. "faml": Factors are extracted using the maximum likelihood estimation procedure using the `factanal` function. "fapa": Factors are extracted using the iterated principal axis factoring estimation procedure using the `fapa` function. "faregLS": Factors are extracted using regularized least squares factor analysis using the `fareg` function. "faregML": Factors are extracted using regularized maximum likelihood factor using the `fareg` function. "pca": Principal components are extracted. `urLoadings` (Matrix) An unrotated factor-structure matrix to be rotated. `rotate` (Character) Designate which rotation algorithm to apply. The following are available rotation options: "oblimin", "quartimin", "targetT", "targetQ", "oblimax", "entropy", "quartimax", "varimax", "simplimax", "bentlerT", "bentlerQ", "tandemI", "tandemII", "geominT", "geominQ", "cfT", "cfQ", "infomaxT", "infomaxQ", "mccammon", "bifactorT", "bifactorQ", and "none". Defaults to rotate = "oblimin". See GPArotation package for more details. Note that rotations ending in "T" and "Q" represent orthogonal and oblique rotations, respectively. `targetMatrix` (Matrix) This argument serves two functions. First, if a user has requested either a "targetT" or "targetQ' rotation, then the target matrix is used to conduct a fully or partially specified target rotation. In the latter case, freely estimated factor loadings are designated by "NA" values and rotation will be conducted using Browne's (1972a, 1972b, 2001) method for a partially-specified target rotation. Second, if any other rotation option is chosen then all rotated loadings matrices (and assorted output) will be aligned (but not rotated) with the target solution. `bootstrapSE` (Logical) Computes bootstrap standard errors. All bootstrap samples are aligned to the global minimum solution. Defaults to bootstrapSE = FALSE (no standard errors). `numBoot` (Numeric) The number bootstraps. Defaults to numBoot = 1000. `CILevel` (Numeric) The confidence level (between 0 and 1) of the bootstrap confidence interval. Defaults to CILevel = .95. `Seed` (Numeric) Starting seed for reproducible bootstrap results and factor rotations. Defaults to Seed = 1. `digits` (Numeric) Rounds the values to the specified number of decimal places. Defaults to digits = NULL (no rounding). `faControl` (List) A list of optional parameters passed to the factor extraction (`faX`) function. treatHeywood: (Logical) In `fals`, if treatHeywood is true, a penalized least squares function is used to bound the communality estimates below 1.0. Defaults to treatHeywood = TRUE. nStart: (Numeric) The number of starting values to be tried in `faml`. Defaults to nStart = 10. start: (Matrix) NULL or a matrix of starting values, each column giving an initial set of uniquenesses. Defaults to start = NULL. maxCommunality: (Numeric) In `faml`, set the maximum communality value for the estimated solution. Defaults to maxCommunality = .995. epsilon: (Numeric) In `fapa`, the numeric threshold designating when the algorithm has converged. Defaults to epsilon = 1e-4. communality: (Character) The method used to estimate the initial communality values in `fapa`. Defaults to communality = 'SMC'. "SMC": Initial communalities are estimated by taking the squared multiple correlations of each indicator after regressing the indicator on the remaining variables. "maxr": Initial communalities equal the largest (absolute value) correlation in each column of the correlation matrix. "unity": Initial communalities equal 1.0 for all variables. maxItr: (Numeric) In `fapa`, the maximum number of iterations to reach convergence. Defaults to maxItr = 15,000. `rotateControl` (List) A list of control values to pass to the factor rotation algorithms. numberStarts: (Numeric) The number of random (orthogonal) starting configurations for the chosen rotation method (e.g., oblimin). The first rotation will always commence from the unrotated factors orientation. Defaults to numberStarts = 10. gamma: (Numeric) This is a tuning parameter (between 0 and 1, inclusive) for an oblimin rotation. See the GPArotation library's oblimin documentation for more details. Defaults to gamma = 0 (i.e., a quartimin rotation). delta: (Numeric) This is a tuning parameter for the geomin rotation. It adds a small number (default = .01) to the squared factor loadings before computing the geometric means in the discrepancy function. kappa: (Numeric) The main parameterization of the Crawford-Ferguson (CF) rotations (i.e., "cfT" and "cfQ" for orthogonal and oblique CF rotation, respectively). Defaults to kappa = 0. k: (Numeric) A specific parameter of the simplimax rotation. Defaults to k = the number of observed variables. standardize: (Character) The standardization routine used on the unrotated factor structure. The three options are "none", "Kaiser", and "CM". Defaults to standardize = "none". "none": No standardization is applied to the unrotated factor structure. "Kaiser": Use a factor structure matrix that has been normed by Kaiser's method (i.e., normalize all rows to have a unit length). "CM": Use a factor structure matrix that has been normed by the Cureton-Mulaik method. epsilon: (Numeric) The rotational convergence criterion to use. Defaults to epsilon = 1e-5. power: (Numeric) Raise factor loadings the the n-th power in the `promaxQ` rotation. Defaults to power = 4. maxItr: (Numeric) The maximum number of iterations for the rotation algorithm. Defaults to maxItr = 15000. `...` Values to be passed to the `cor` function. use: (Character) A character string giving a method for computing correlations in the presence of missing values: "everything" (the default), "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs". method: (Character) A character string indicating which correlation coefficient is to be computed: "pearson" (the default), "kendall", or "spearman". na.rm: (Logical) Should missing values be removed (TRUE) or not (FALSE)?

## Details

• Global Minimum: This function uses several random starting configurations for factor rotations in an attempt to find the global minimum solution. However, this function is not guaranteed to find the global minimum. Furthermore, the global minimum solution need not be more psychologically interpretable than any of the local solutions (cf. Rozeboom, 1992). As is recommended, our function returns all local solutions so users can make their own judgements.

• Finding clusters of local minima: We find local-solution sets by sorting the rounded rotation complexity values (to the number of digits specified in the `epsilon` argument of the `rotateControl` list) into sets with equivalent values. For example, by default `epsilon = 1e-5.` and thus will only evaluate the complexity values to five significant digits. Any differences beyond that value will not effect the final sorting.

## Value

The `faMain` function will produce a lot of output in addition to the rotated factor pattern matrix and the factor correlations.

• R: (Matrix) Returns the correlation matrix, useful when raw data are supplied.

• loadings: (Matrix) The rotated factor solution with the lowest evaluated discrepancy function. This solution has the lowest discrepancy function of the examined random starting configurations. It is not guaranteed to find the "true" global minimum. Note that multiple (or even all) local solutions can have the same discrepancy functions.

• Phi: (Matrix) The factor correlations of the rotated factor solution with the lowest evaluated discrepancy function (see Details).

• facIndeterminacy: (Vector) A vector (with length equal to the number of factors) containing Guttman's (1955) index of factor indeterminacy for each factor.

• h2: (Vector) The vector of final communality estimates.

• CILevel (Numeric) The user-defined confidence level (between 0 and 1) of the bootstrap confidence interval. Defaults to CILevel = .95.

• loadingsCIupper: (Matrix) Contains the upper confidence interval of the bootstrapped factor loadings matrix. The confidence interval width is specified by the user.

• loadingsCIlower: (Matrix) Contains the lower confidence interval of the bootstrapped factor loadings matrix. The confidence interval width is specified by the user.

• PhiSE: (Matrix) The matrix of factor correlation standard errors across the bootstrapped factor solutions. Each matrix element is the standard deviation of all bootstrapped factor correlations for that element position.

• PhiCIupper: (Matrix) Contains the upper confidence interval of the bootstrapped factor correlation matrix. The confidence interval width is specified by the user.

• PhiCIlower: (Matrix) Contains the lower confidence interval of the bootstrapped factor correlation matrix. The confidence interval width is specified by the user.

• facIndeterminacySE: (Matrix) A row vector containing the standard errors of Guttman's (1955) factor indeterminacy indices across the bootstrap factor solutions.

• localSolutions: (List) A list containing all local solutions in ascending order of their factor loadings, rotation complexity values (i.e., the first solution is the "global" minimum). Each solution returns the

• Phi: (Matrix) factor correlations,

• RotationComplexityValue: (Numeric) the complexity value of the rotation algorithm,

• facIndeterminacy: (Vector) A vector of factor indeterminacy indices for each common factor, and

• RotationConverged: (Logical) convergence status of the rotation algorithm.

• numLocalSets (Numeric) How many sets of local solutions with the same discrepancy value were obtained.

• localSolutionSets: (List) A list containing the sets of unique local minima solutions. There is one list element for every unique local solution that includes (a) the factor loadings matrix, (b) the factor correlation matrix (if estimated), and (c) the discrepancy value of the rotation algorithm.

• loadingsArray: (Array) Contains an array of all bootstrapped factor loadings. The dimensions are factor indicators, factors, and the number of bootstrapped samples (representing the row, column, and depth, respectively).

• PhiArray: (Array) Contains an array of all bootstrapped factor correlations. The dimension are the number of factors, the number of factors, and the number of bootstrapped samples (representing the row, column, and depth, respectively).

• facIndeterminacyArray: (Array) Contains an array of all bootstrap factor indeterminacy indices. The dimensions are 1, the number of factors, and the number of bootstrap samples (representing the row, column, and depth order, respectively).

• faControl: (List) A list of the control parameters passed to the factor extraction (`faX`) function.

• faFit: (List) A list of additional output from the factor extraction routines.

• facMethod: (Character) The factor extraction routine.

• df: (Numeric) Degrees of Freedom from the maximum likelihood factor extraction routine.

• n: (Numeric) Sample size associated with the correlation matrix.

• objectiveFunc: (Numeric) The evaluated objective function for the maximum likelihood factor extraction routine.

• RMSEA: (Numeric) Root mean squared error of approximation from Steiger & Lind (1980). Note that bias correction is computed if the sample size is provided.

• testStat: (Numeric) The significance test statistic for the maximum likelihood procedure. Cannot be computed unless a sample size is provided.

• pValue: (Numeric) The p value associated with the significance test statistic for the maximum likelihood procedure. Cannot be computed unless a sample size is provided.

• gradient: (Matrix) The solution gradient for the least squares factor extraction routine.

• maxAbsGradient: (Numeric) The maximum absolute value of the gradient at the least squares solution.

• Heywood: (Logical) TRUE if a Heywood case was produced.

• convergedX: (Logical) TRUE if the factor extraction routine converged.

• convergedR: (Logical) TRUE if the factor rotation routine converged (for the local solution with the minimum discrepancy value).

• rotateControl: (List) A list of the control parameters passed to the rotation algorithm.

• unSpunSolution: (List) A list of output parameters (e.g., loadings, Phi, etc) from the rotated solution that was obtained by rotating directly from the unrotated (i.e., unspun) common factor orientation.

• targetMatrix (Matrix) The input target matrix if supplied by the user.

• Call: (call) A copy of the function call.

## Author(s)

• Niels G. Waller (nwaller@umn.edu)

• Casey Giordano (Giord023@umn.edu)

• The authors thank Allie Cooperman and Hoang Nguyen for their help implementing the standard error estimation and the Cureton-Mulaik standardization procedure.

## References

Browne, M. W. (1972). Oblique rotation to a partially specified target. British Journal of Mathematical and Statistical Psychology, 25,(1), 207-212.

Browne, M. W. (1972b). Orthogonal rotation to a partially specifed target. British Journal of Statistical Psychology, 25,(1), 115-120.

Browne, M. W. (2001). An overview of analytic rotation in exploratory factor analysis. Multivariate Behavioral Research, 36(1), 111-150.

Cureton, E. E., & Mulaik, S. A. (1975). The weighted varimax rotation and the promax rotation. Psychometrika, 40(2), 183-195.

Guttman, L. (1955). The determinacy of factor score matrices with implications for five other basic problems of common factor theory. British Journal of Statistical Psychology, 8(2), 65-81.

Jung, S. & Takane, Y. (2008). Regularized common factor analysis. New Trends in Psychometrics, 141-149.

Mansolf, M., & Reise, S. P. (2016). Exploratory bifactor analysis: The Schmid-Leiman orthogonalization and Jennrich-Bentler analytic rotations. Multivariate Behavioral Research, 51(5), 698-717.

Rozeboom, W. W. (1992). The glory of suboptimal factor rotation: Why local minima in analytic optimization of simple structure are more blessing than curse. Multivariate Behavioral Research, 27(4), 585-599.

Zhang, G. (2014). Estimating standard errors in exploratory factor analysis. Multivariate Behavioral Research, 49(4), 339-353.

Other Factor Analysis Routines: `BiFAD()`, `Box26`, `GenerateBoxData()`, `Ledermann()`, `SLi()`, `SchmidLeiman()`, `faAlign()`, `faEKC()`, `faIB()`, `faLocalMin()`, `faMB()`, `faScores()`, `faSort()`, `faStandardize()`, `faX()`, `fals()`, `fapa()`, `fareg()`, `fsIndeterminacy()`, `orderFactors()`, `print.faMB()`, `print.faMain()`, `promaxQ()`, `summary.faMB()`, `summary.faMain()`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97``` ```## Example 1 ## Generate an orthogonal factor model lambda <- matrix(c(.41, .00, .00, .45, .00, .00, .53, .00, .00, .00, .66, .00, .00, .38, .00, .00, .66, .00, .00, .00, .68, .00, .00, .56, .00, .00, .55), nrow = 9, ncol = 3, byrow = TRUE) ## Generate factor correlation matrix Phi <- matrix(.50, nrow = 3, ncol = 3) diag(Phi) <- 1 ## Model-implied correlation matrix R <- lambda %*% Phi %*% t(lambda) diag(R) <- 1 ## Load the MASS package to create multivariate normal data library(MASS) ## Generate raw data to perfectly reproduce R X <- mvrnorm(Sigma = R, mu = rep(0, nrow(R)), empirical = TRUE, n = 300) ## Not run: ## Execute 50 promax rotations from a least squares factor extraction ## Compute 100 bootstrap samples to compute standard errors and ## 80 percent confidence intervals Out1 <- faMain(X = X, numFactors = 3, facMethod = "fals", rotate = "promaxQ", bootstrapSE = TRUE, numBoot = 100, CILevel = .80, faControl = list(treatHeywood = TRUE), rotateControl = list(numberStarts = 2, power = 4, standardize = "Kaiser"), digits = 2) Out1[c("loadings", "Phi")] ## End(Not run) ## Example 2 ## Load Thurstone's (in)famous box data data(Thurstone, package = "GPArotation") ## Execute 5 oblimin rotations with Cureton-Mulaik standardization Out2 <- faMain(urLoadings = box26, rotate = "oblimin", bootstrapSE = FALSE, rotateControl = list(numberStarts = 5, standardize = "CM", gamma = 0, epsilon = 1e-6), digits = 2) Out2[c("loadings", "Phi")] ## Example 3 ## Factor matrix from Browne 1972 lambda <- matrix(c(.664, .322, -.075, .688, .248, .192, .492, .304, .224, .837, -.291, .037, .705, -.314, .155, .820, -.377, -.104, .661, .397, .077, .457, .294, -.488, .765, .428, .009), nrow = 9, ncol = 3, byrow = TRUE) ## Create partially-specified target matrix Targ <- matrix(c(NA, 0, NA, NA, 0, 0, NA, 0, 0, NA, NA, NA, NA, NA, 0, NA, NA, NA, .7, NA, NA, 0, NA, NA, .7, NA, NA), nrow = 9, ncol = 3, byrow = TRUE) ## Perform target rotation Out3 <- faMain(urLoadings = lambda, rotate = "targetT", targetMatrix = Targ, digits = 3)\$loadings Out3 ```