This function will extract 181 features from the data according to the method by Goretzko & Buhner (2020).

extractor.feature.FF(
  response,
  cor.type = "pearson",
  use = "pairwise.complete.obs"
)

Arguments

response

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

cor.type

A character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman". @seealso cor.

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 (1×181) containing all the 181 features (Goretzko & Buhner, 2020).

Details

The code for the extractor.feature.FF function is implemented based on the publicly available code by Goretzko & Buhner (2020) (https://osf.io/mvrau/). The extracted features are completely consistent with the 181 features described in the original text by Goretzko & Buhner (2020). These features include:

  • 1. - Number of examinees

  • 2. - Number of items

  • 3. - Number of eigenvalues greater than 1

  • 4. - Proportion of variance explained by the 1st eigenvalue

  • 5. - Proportion of variance explained by the 2nd eigenvalue

  • 6. - Proportion of variance explained by the 3rd eigenvalue

  • 7. - Number of eigenvalues greater than 0.7

  • 8. - Standard deviation of the eigenvalues

  • 9. - Number of eigenvalues accounting for 50

  • 10. - Number of eigenvalues accounting for 75

  • 11. - L1-norm of the correlation matrix

  • 12. - Frobenius-norm of the correlation matrix

  • 13. - Maximum-norm of the correlation matrix

  • 14. - Average of the off-diagonal correlations

  • 15. - Spectral-norm of the correlation matrix

  • 16. - Number of correlations smaller or equal to 0.1

  • 17. - Average of the initial communality estimates

  • 18. - Determinant of the correlation matrix

  • 19. - Measure of sampling adequacy (MSA after Kaiser, 1970)

  • 20. - Gini coefficient (Gini, 1921) of the correlation matrix

  • 21. - Kolm measure of inequality (Kolm, 1999) of the correlation matrix

  • 22-101. - Eigenvalues from Principal Component Analysis (PCA), padded with -1000 if insufficient

  • 102-181. - Eigenvalues from Factor Analysis (FA), fixed at 1 factor, padded with -1000 if insufficient

References

Goretzko, D., & Buhner, M. (2020). One model to rule them all? Using machine learning algorithms to determine the number of factors in exploratory factor analysis. Psychol Methods, 25(6), 776-786. https://doi.org/10.1037/met0000262.

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 extractor.feature.FF function with default parameters.
# \donttest{
 features <- extractor.feature.FF(response)

 print(features)
#>      N  I eiggreater1   releig1   releig2  releig3 eiggreater07 sdeigval var50
#> 1 2436 25           6 0.2053724 0.3154479 0.401156            9 1.055289     5
#>   var75  onenorm frobnorm   maxnorm   avgcor specnorm smlcor    avgcom
#> 1    12 6.597807 7.192164 0.7182598 0.166283 5.134311    326 0.3626741
#>            det       KMO Gini      Kolm  eigval1  eigval2  eigval3  eigval4
#> 1 0.0005640639 0.8486452 0.52 0.1184304 5.134311 2.751887 2.142702 1.852328
#>    eigval5  eigval6   eigval7   eigval8   eigval9  eigval10  eigval11  eigval12
#> 1 1.548163 1.073582 0.8395389 0.7992062 0.7189892 0.6880888 0.6763734 0.6517998
#>   eigval13  eigval14  eigval15  eigval16  eigval17  eigval18  eigval19 eigval20
#> 1 0.623253 0.5965628 0.5630908 0.5433053 0.5145175 0.4945031 0.4826395 0.448921
#>    eigval21  eigval22  eigval23  eigval24 eigval25 eigval26 eigval27 eigval28
#> 1 0.4233661 0.4006715 0.3878045 0.3818568 0.262539    -1000    -1000    -1000
#>   eigval29 eigval30 eigval31 eigval32 eigval33 eigval34 eigval35 eigval36
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval37 eigval38 eigval39 eigval40 eigval41 eigval42 eigval43 eigval44
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval45 eigval46 eigval47 eigval48 eigval49 eigval50 eigval51 eigval52
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval53 eigval54 eigval55 eigval56 eigval57 eigval58 eigval59 eigval60
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval61 eigval62 eigval63 eigval64 eigval65 eigval66 eigval67 eigval68
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval69 eigval70 eigval71 eigval72 eigval73 eigval74 eigval75 eigval76
#> 1    -1000    -1000    -1000    -1000    -1000    -1000    -1000    -1000
#>   eigval77 eigval78 eigval79 eigval80 fa_eigval1 fa_eigval2 fa_eigval3
#> 1    -1000    -1000    -1000    -1000   4.364152   1.921595   1.305208
#>   fa_eigval4 fa_eigval5 fa_eigval6   fa_eigval7 fa_eigval8 fa_eigval9
#> 1  0.9707252  0.7246551  0.2227041 0.0009696356 -0.0250934 -0.1108051
#>   fa_eigval10 fa_eigval11 fa_eigval12 fa_eigval13 fa_eigval14 fa_eigval15
#> 1   -0.134687  -0.1619359  -0.2056736  -0.2254103  -0.2383512  -0.2603974
#>   fa_eigval16 fa_eigval17 fa_eigval18 fa_eigval19 fa_eigval20 fa_eigval21
#> 1  -0.2775633  -0.3024934   -0.312759  -0.3247359  -0.3450822  -0.3720205
#>   fa_eigval22 fa_eigval23 fa_eigval24 fa_eigval25 fa_eigval26 fa_eigval27
#> 1  -0.3801292  -0.4332142  -0.4490801  -0.5862909       -1000       -1000
#>   fa_eigval28 fa_eigval29 fa_eigval30 fa_eigval31 fa_eigval32 fa_eigval33
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval34 fa_eigval35 fa_eigval36 fa_eigval37 fa_eigval38 fa_eigval39
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval40 fa_eigval41 fa_eigval42 fa_eigval43 fa_eigval44 fa_eigval45
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval46 fa_eigval47 fa_eigval48 fa_eigval49 fa_eigval50 fa_eigval51
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval52 fa_eigval53 fa_eigval54 fa_eigval55 fa_eigval56 fa_eigval57
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval58 fa_eigval59 fa_eigval60 fa_eigval61 fa_eigval62 fa_eigval63
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval64 fa_eigval65 fa_eigval66 fa_eigval67 fa_eigval68 fa_eigval69
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval70 fa_eigval71 fa_eigval72 fa_eigval73 fa_eigval74 fa_eigval75
#> 1       -1000       -1000       -1000       -1000       -1000       -1000
#>   fa_eigval76 fa_eigval77 fa_eigval78 fa_eigval79 fa_eigval80
#> 1       -1000       -1000       -1000       -1000       -1000


# }