# Example 2: Assessing Factor Simplicity from psych::fa() Output

# Example 2: Assessing Factor Simplicity from `psych::fa()` Output

This example demonstrates how to compute factor simplicity and complexity indices using loadings obtained from an exploratory factor analysis conducted via `psych::fa()`.

## Step 1: Load data from `psych`

We use the `bfi` dataset available in the `psych` package.

    data(bfi, package = "psych")

## Step 2: Fit a 2-factor exploratory model

We fit an EFA model with 2 factors using oblimin rotation and unweighted least squares (ULS) estimation.

    fa.output <- psych::fa(bfi[, 1:10],
                           nfactors = 2,
                           rotate = "oblimin",
                           fm = "uls")
    #> Loading required namespace: GPArotation

## Step 3: View and save the loading matrix

We inspect the factor loadings and convert them to a standard data frame for analysis.

    unclass(fa.output$loadings)
    #>            ULS1        ULS2
    #> A1  0.079554169 -0.40549069
    #> A2  0.006997768  0.67731413
    #> A3 -0.028283712  0.75951938
    #> A4  0.144929848  0.43871781
    #> A5  0.027453135  0.60237324
    #> C1  0.570727318 -0.06069240
    #> C2  0.636805972 -0.01326282
    #> C3  0.541558551  0.03162627
    #> C4 -0.649199561 -0.00367440
    #> C5 -0.561775361 -0.05795960
    fa.load <- as.data.frame(unclass(fa.output$loadings))

## Step 4: Compute complexity and simplicity indices

We now use the `facomplex` package to compute various measures of factor simplicity and complexity.

### Hofmann Index

    Hofmann(fa.load)
    #>     CHof CHof_R
    #> A1 1.077  0.929
    #> A2 1.000  1.000
    #> A3 1.003  0.997
    #> A4 1.216  0.823
    #> A5 1.004  0.996
    #> C1 1.023  0.978
    #> C2 1.001  0.999
    #> C3 1.007  0.993
    #> C4 1.000  1.000
    #> C5 1.021  0.979

### Bentler’s Simplicity Index

    BSI(fa.load)
    #> [1] 0.9998469

### Kaiser-Cerny (KC) Criterion

    KC(data = fa.load, b = 4)
    #> Kaiser-Cerny Factor Simplicity Analysis:
    #> - Threshold f_j for hyperplane inclusion (per factor):
    #>   F1: 0.242545
    #>   F2: 0.212566
    #>
    #> - Ideal hyperplane count:  10

### Factor Simplicity Index (FSI)

We define the target items for each factor to compute the total, factor-level, and item-level simplicity.

    simload(data = fa.load,
        items_target = list(
          ULS1 = c(6,7,8,9,10),
          ULS2 = c(1,2,3,4,5)
        ))
    #> $TSFI
    #> [1] 0.99
    #>
    #> $SFI
    #>  ULS1  ULS2
    #> 0.984 0.995
    #>
    #> $IFS
    #>    Items   IFS
    #> 1     C1 0.989
    #> 2     C2 1.000
    #> 3     C3 0.997
    #> 4     C4 1.000
    #> 5     C5 0.989
    #> 6     A1 0.962
    #> 7     A2 1.000
    #> 8     A3 0.999
    #> 9     A4 0.891
    #> 10    A5 0.998

This example shows how to apply `facomplex` to factor solutions derived from classical exploratory methods, making it an accessible tool for researchers working with `psych::fa()` and other traditional EFA approaches.