# faSort: Sort a factor loadings matrix In fungible: Psychometric Functions from the Waller Lab

 faSort R Documentation

### Description

faSort takes an unsorted factor pattern or structure matrix and returns a sorted matrix with (possibly) reflected columns. Sorting is done such that variables that load on a common factor are grouped together for ease of interpretation.

### Usage

``````faSort(fmat, phi = NULL, BiFactor = FALSE, salient = 0.25, reflect = TRUE)
``````

### Arguments

 `fmat` factor loadings (pattern or structure) matrix. `phi` factor correlation matrix. Default = NULL. If reflect = TRUE then phi will be corrected to match the new factor orientations. `BiFactor` (logical) Is the solution a bifactor model? `salient` factor markers with loadings >= abs(salient) will be saved in the markers list. Note that a variable can be a marker of more than one factor. `reflect` (logical) if reflect = TRUE then the factors will be reflected such that salient loadings are mostly positive.

### Value

 `loadings` sorted factor loadings matrix. `phi` reflected factor correlation matrix when phi is given as an argument. `markers` A list of factor specific markers with loadings >= abs(salient). Markers are sorted by the absolute value of the salient factor loadings. `sortOrder` sorted row numbers. `SEmat` The SEmat is a so-called Start-End matrix that lists the first (start) and last (end) row for each factor in the sorted pattern matrix.

### Author(s)

Niels Waller

`fals`

Other Factor Analysis Routines: `BiFAD()`, `Box26`, `GenerateBoxData()`, `Ledermann()`, `SLi()`, `SchmidLeiman()`, `faAlign()`, `faEKC()`, `faIB()`, `faLocalMin()`, `faMB()`, `faMain()`, `faScores()`, `faStandardize()`, `faX()`, `fals()`, `fapa()`, `fareg()`, `fsIndeterminacy()`, `orderFactors()`, `print.faMB()`, `print.faMain()`, `promaxQ()`, `summary.faMB()`, `summary.faMain()`

### Examples

``````
set.seed(123)
F <- matrix( c( .5,  0,
.6,  0,
0, .6,
.6,  0,
0, .5,
.7,  0,
0, .7,
0, .6), nrow = 8, ncol = 2, byrow=TRUE)

Rex1 <- F %*% t(F); diag(Rex1) <- 1

Items <- c("1. I am often tense.\n",
"2. I feel anxious much of the time.\n",
"3. I am a naturally curious individual.\n",
"4. I have many fears.\n",
"5. I read many books each year.\n",
"6. My hands perspire easily.\n",
"7. I have many interests.\n",
"8. I enjoy learning new words.\n")

exampleOut <- fals(R = Rex1, nfactors = 2)

# Varimax rotation

# Sort items and reflect factors
salient = .25,
reflect = TRUE)