Skip to contents

Perform parallel analysis, factor analysis, bifactor analysis and hierarchical clustering.

Usage

factorize(
  x,
  n_factors = NULL,
  method = "minres",
  rotation = "oblimin",
  scores = "regression",
  cor = "cor",
  fa_n_iter = 100,
  omega_method = "minres",
  omega_rotation = c("oblimin", "simplimax", "promax", "cluster", "target"),
  omega_n_iter = 1,
  x_name = NULL,
  print_plot = TRUE,
  do_pa = TRUE,
  do_fa = TRUE,
  do_bifactor = TRUE,
  do_hclust = FALSE,
  verbosity = 1L,
  ...
)

Arguments

x

Data. Will be coerced to data frame

n_factors

Integer: If NULL, will be estimated using parallel analysis

method

Character: Factor analysis method: "minres": minimum residual (OLS), "wls": weighted least squares (WLS); "gls": generalized weighted least squares (GLS); "pa": principal factor solution; "ml": maximum likelihood; "minchi": minimize the sample size weighted chi square when treating pairwise correlations with different number of subjects per pair; "minrank": minimum rank factor analysis.

rotation

Character: Rotation methods. No rotation: "none"; Orthogonal: "varimax", "quartimax", "bentlerT", "equamax", "varimin", "geominT", "bifactor"; Oblique: "promax", "oblimin", "simplimax", "bentlerQ, "geominQ", "biquartimin", "cluster".

scores

Character: Factor score estimation method. Options: "regression", "Thurstone": simple regression, "tenBerge": correlation-preserving, "Anderson", "Barlett".

cor

Character: Correlation method: "cor": Pearson correlation, "cov": Covariance, "tet": tetrachoric, "poly": polychoric, "mixed": mixed cor for a mixture of tetrachorics, polychorics, Pearsons, biserials, and polyserials, "Yuleb": Yulebonett, "Yuleq" and "YuleY": Yule coefficients

fa_n_iter

Integer: Number of iterations for factor analysis.

omega_method

Character: Factor analysis method for the bifactor analysis. Same options as method

omega_rotation

Character: Rotation method for bifactor analysis: "oblimin", "simplimax", "promax", "cluster", "target".

omega_n_iter

Integer: Number of iterations for bifactor analysis.

x_name

Character: Name your dataset. Used for plotting

print_plot

Logical: If TRUE, print plots along the way.

do_pa

Logical: If TRUE, perform parallel analysis.

do_fa

Logical: If TRUE, perform factor analysis.

do_bifactor

Logical: If TRUE, perform bifactor analysis.

do_hclust

Logical: If TRUE, perform hierarchical cluster analysis.

verbosity

Integer: Verbosity level.

...

Additional arguments to pass to psych::fa

Value

List with the following elements:

parallel_analysis

Results from parallel analysis

factor_analysis

Results from factor analysis

factor_scores

Factor scores

bifactor_analysis

Results from bifactor analysis

bifactor_scores

Bifactor scores

hclust

Results from hierarchical cluster analysis

Details

Consult psych::fa for more information on the parameters.

Author

EDG