A function performs clustering on items by calling VSS and fa. Apply the Very Simple Structure (VSS), Comparative Fit Index (CFI), MAP, and other criteria to determine the appropriate number of factors.

EFAindex(
  response,
  nfact.max = 10,
  cor.type = "cor",
  use = "pairwise.complete.obs"
)

Arguments

response

A required N × I matrix or data.frame consisting of the responses of N individuals to I items.

nfact.max

The maximum number of factors discussed by CD approach. (default = 10)

cor.type

How to find the correlations: "cor" is Pearson", "cov" is covariance, "tet" is tetrachoric, "poly" is polychoric, "mixed" uses mixed cor for a mixture of tetrachorics, polychorics, Pearsons, biserials, and polyserials, Yuleb is Yulebonett, Yuleq and YuleY are the obvious Yule coefficients as appropriate.

use

an optional character string giving a method for computing covariances in the presence of missing values. This must be one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). @seealso cor.

Value

A matrix with the following components:

CFI

the Comparative Fit Index

RMSEA

Root Mean Square Error of Approximation (RMSEA) for each number of factors.

SRMR

Standardized Root Mean Square Residual.

MAP

Velicer's MAP values (lower values are better).

BIC

Bayesian Information Criterion (BIC) for each number of factors.

SABIC

Sample-size Adjusted Bayesian Information Criterion (SABIC) for each number of factors.

chisq

Chi-square statistic from the factor analysis output.

df

Degrees of freedom.

prob

Probability that the residual matrix is greater than 0.

eChiSq

Empirically found chi-square statistic.

eCRMS

Empirically found mean residual corrected for degrees of freedom.

eBIC

Empirically found BIC based on the empirically found chi-square statistic.

vss

VSS fit with complexity 1.

sqresid

Squared residual correlations.

fit

Factor fit of the complete model.

Examples

library(EFAfactors)
set.seed(123)

##Take the data.bfi dataset as an example.
data(data.bfi)

response <- as.matrix(data.bfi[, 1:25]) ## loading data
response <- na.omit(response) ## Remove samples with NA/missing values

## Transform the scores of reverse-scored items to normal scoring
response[, c(1, 9, 10, 11, 12, 22, 25)] <- 6 - response[, c(1, 9, 10, 11, 12, 22, 25)] + 1


## Run EFAindex function with default parameters.
# \donttest{
 EFAindex.matrix <- EFAindex(response)

 print(EFAindex.matrix)
#>                CFI      RMSEA        SRMR        MAP        BIC      SABIC
#> nfact=1  0.4182784 0.12448628 0.120381360 0.02492080 8511.96104 9385.70016
#> nfact=2  0.6403758 0.10245111 0.086812504 0.01893728 4711.54990 5509.03542
#> nfact=3  0.7558834 0.08856440 0.065484883 0.01751893 2806.55158 3530.96074
#> nfact=4  0.8416003 0.07505329 0.046269741 0.01569495 1426.40075 2080.91078
#> nfact=5  0.9241558 0.05480192 0.027828538 0.01464488   95.87005  683.65818
#> nfact=6  0.9578829 0.04324144 0.019444842 0.01598014 -370.06460  154.17887
#> nfact=7  0.9728338 0.03691850 0.015943962 0.01937223 -507.71415  -43.83811
#> nfact=8  0.9820607 0.03204015 0.012772031 0.02221546 -550.01283 -143.32698
#> nfact=9  0.9875688 0.02864062 0.010938058 0.02714102 -532.74309 -180.07021
#> nfact=10 0.9913889 0.02576594 0.009299455 0.03318444 -492.14570 -190.30855
#>               chisq  df          prob     eChisq      eCRMS       eBIC
#> nfact=1  10656.4420 275  0.000000e+00 21181.0277 0.12573423 19036.5467
#> nfact=2   6668.8762 251  0.000000e+00 11015.2180 0.09490871  9057.8917
#> nfact=3   4584.5213 228  0.000000e+00  6267.7353 0.07511631  4489.7657
#> nfact=4   3032.8120 206  0.000000e+00  3129.1232 0.05583726  1522.7120
#> nfact=5   1538.5209 185 8.566041e-212  1131.9033 0.03543767  -310.7475
#> nfact=6    916.6240 165 1.612876e-104   552.6337 0.02621942  -734.0549
#> nfact=7    630.8103 146  1.840171e-61   371.5532 0.02285496  -766.9712
#> nfact=8    448.1456 128  4.036746e-37   238.4232 0.01955310  -759.7352
#> nfact=9    332.8474 111  5.215238e-24   174.8674 0.01798206  -690.7231
#> nfact=10   248.6750  95  1.058434e-15   126.3990 0.01652557  -614.4217
#>                vss   sqresid       fit
#> nfact=1  0.4977461 25.980200 0.4977461
#> nfact=2  0.5494075 18.663534 0.6391932
#> nfact=3  0.5688084 14.451767 0.7206159
#> nfact=4  0.5918604 11.266626 0.7821916
#> nfact=5  0.5418571  9.118059 0.8237280
#> nfact=6  0.5423908  8.129987 0.8428296
#> nfact=7  0.5110725  7.680570 0.8515179
#> nfact=8  0.5077103  7.248978 0.8598615
#> nfact=9  0.4978953  6.966809 0.8653164
#> nfact=10 0.4824834  6.646780 0.8715033

# }