estimate_control() and rotate_control() collect the estimation and rotation
tuning arguments of a factor analysis into two small, validated objects. They
are a declarative surface over the same settings resolved internally by the
package's estimation and rotation engines, so that a fit's many tuning knobs can
be prepared, inspected, and reused as a single value instead of being passed one
by one.
Usage
estimate_control(
type = c("EFAtools", "psych", "SPSS", "none"),
init_comm = NA,
criterion = NA,
criterion_type = NA,
max_iter = NA,
abs_eigen = NA,
start_method = "psych",
fiml_max_iter = 500,
fiml_tol = 1e-05
)
rotate_control(
type = c("EFAtools", "psych", "SPSS", "none"),
normalize = TRUE,
precision = 1e-05,
order_type = NA,
varimax_type = NA,
p_type = NA,
k = NA,
random_starts = 100,
...
)Arguments
- type
character. One of
"EFAtools"(default),"psych","SPSS", or"none". Selects the preset that fills theNA-defaulted knobs below when the control is used to fit a model.- init_comm
character. Method for the initial communalities in principal axis factoring:
"smc"(squared multiple correlations),"mac"(maximum absolute correlations), or"unity".NA(default) resolves fromtype.- criterion
numeric. The convergence criterion for principal axis factoring: iteration stops once the change in communalities falls below it. A single number greater than 0 and smaller than 1;
NA(default) resolves fromtype.- criterion_type
character. The convergence criterion type for principal axis factoring:
"max_individual"(the largest change in any communality, as in SPSS) or"sum"(the change in the summed communalities, as inpsych::fa()).NA(default) resolves fromtype.- max_iter
numeric. The maximum number of principal-axis-factoring iterations before the procedure is halted with a warning. A single whole number of at least 1;
NA(default) resolves fromtype.- abs_eigen
logical. Which algorithm the principal-axis-factoring iterations use:
FALSEcomputes the loadings from the eigenvalues (as inpsych::fa());TRUEuses the absolute eigenvalues (as in SPSS).NA(default) resolves fromtype.- start_method
character. Starting values for the maximum-likelihood optimiser:
"psych"(default, thepsych::fa()starts) or"factanal"(thestats::factanal()starts); abbreviations are matched. Not governed bytype. Only maximum likelihood uses it, soNAleaves it unset and is rejected only by a fit that is actually run withestimator = "ML".- fiml_max_iter
numeric. The maximum number of EM iterations used to estimate the two-stage full-information maximum-likelihood moments from raw data with missing values (
cor_method = "fiml"); the last iterate is returned, with a warning, if the cap is reached. A single whole number of at least 1; default500. Not governed bytype, and unused by every other correlation method. The EM converges linearly and needs more iterations the larger the fraction of missing information, so raise it when a fit reports that the moments did not converge.- fiml_tol
numeric. The convergence tolerance of that EM: iteration stops once the largest change in the standardized moments (the standardized means, log-variances, and correlations) falls below it, so it does not depend on the variables' measurement scale. A single number greater than 0 and smaller than 1 (at or above 1 the criterion is met immediately and the starting moments would be returned as converged); default
1e-5. Not governed bytype.- normalize
logical. If
TRUE(default), a Kaiser normalization is performed before the rotation. The one knob that is always on unless you turn it off withFALSE.- precision
numeric. The convergence tolerance of the rotation procedure. A single number greater than 0 and at most 1; default
1e-5. Each rotation stage monitors its own quantity, so the same number is not the same tolerance everywhere:varimax_type = "kaiser"stops on the absolute change in the varimax simplicity criterion, which is an average over variables (and so does not scale with how many there are) but rises with the number of factors, roughly toward1 - 1 / n_factors, so a fixed value is a relatively weaker tolerance the more factors are extracted;varimax_type = "svd"stops on the relative change in the singular values (as instats::varimax()); and the criterion rotations fitted by gradient projection stop when the projected-gradient norm falls below it. Promax inherits whichever of the two varimax tests itsvarimax_typeselects, because it rotates a varimax base.- order_type
character. How the factors are ordered:
"eigen"(by descending sum of squared loadings, as inpsych::fa()) or"ss_factors"(by descending unweighted sum of squared loadings).NA(default) resolves fromtype.- varimax_type
character. The varimax variant used (for the varimax and promax rotations):
"svd"(as instats::varimax()) or"kaiser"(the SPSS / Kaiser (1958) procedure).NA(default) resolves fromtype.- p_type
character. How the promax target matrix is computed:
"unnorm"(the unnormalized target of Hendrickson & White (1964), also used by psych and stats) or"norm"(the normalized target used by SPSS).NA(default) resolves fromtype.- k
numeric. The promax power (for the target matrix) or the number of near-zero loadings for simplimax. A single number greater than 0;
NA(default) leaves it to the fit (thetype-dependent promax value, ornrow(loadings)for simplimax). Simplimax counts loadings, so a fit using it additionally requires a whole number no larger than the number of loadings in the solution; promax's power has no such restriction.- random_starts
numeric. The number of random starts used by the criterion-based rotations to guard against local minima. A single whole number of at least 0, where
0runs the rotation from its warm start only; default100. The default suffices for the smooth criteria;simplimaxremains materially start-dependent at it, so raise it there (see the Rotations section ofefa_fit()).- ...
Additional arguments forwarded to the rotation engine. Only the names a rotation engine can consume are accepted:
maxit(a whole number of at least 0 bounding a single gradient-projection optimization – the multi-start search runs several of them and each is bounded separately, so it is not a budget for the run as a whole; varimax and promax have no such stage and take onlyprecision), and the criterion parametersgam(oblimin;gam = 0is the recommended default, and larger values increasingly reward correlated factors and can drive the solution toward factor collapse, so inspectPhibefore interpreting a fit withgam > 0) anddelta(geomin; a positive number, default0.01); anything else is rejected as a misspelling. They are stored inextra_argsand passed on to the rotation engine when the control is used to fit a model; an extra a given fit's rotation does not consume is ignored by that fit, so one control can serve fits with different rotations. An estimation knob (which belongs inestimate_control()) or one of the former spellingsP_typeandrandomStartsis likewise rejected here, because the fit would silently drop it.
Value
estimate_control() returns a list of class efa_estimate_control with
the components type, init_comm, criterion, criterion_type, max_iter,
abs_eigen, start_method, fiml_max_iter, and fiml_tol.
rotate_control() returns a list of class
efa_rotate_control with the components type, normalize, precision,
order_type, varimax_type, p_type, k, random_starts, and extra_args
(a named list of any additional arguments forwarded to the rotation engine).
Details
Each argument that governs a type preset defaults to NA, meaning "leave this
knob to the preset". Setting type to one of "EFAtools", "psych", or
"SPSS" fills those knobs from the corresponding preset when the fit is run;
setting type = "none" requires the relevant knobs to be supplied explicitly.
The control object only records the chosen type and the knobs you set: the
preset is resolved (and any "argument set alongside type" warning issued) when
the object is used to fit a model, exactly as it is today, because which preset
applies depends on the estimator and rotation.
See also
efa_fit(), which takes both controls; efa_retain(), the retention
criteria, and efa_schmid_leiman(), which take an estimate_control for the
fits they run.
Other Control functions:
print.efa_control
Examples
# Estimation knobs taken entirely from a preset:
estimate_control(type = "SPSS")
#> Estimation control (type: "SPSS")
#>
#> init_comm: <from type preset>
#> criterion: <from type preset>
#> criterion_type: <from type preset>
#> max_iter: <from type preset>
#> abs_eigen: <from type preset>
#> start_method: psych
#> fiml_max_iter: 500
#> fiml_tol: 1e-05
# A preset with one knob pinned to a non-preset value:
estimate_control(type = "EFAtools", max_iter = 500)
#> Estimation control (type: "EFAtools")
#>
#> init_comm: <from type preset>
#> criterion: <from type preset>
#> criterion_type: <from type preset>
#> max_iter: 500
#> abs_eigen: <from type preset>
#> start_method: psych
#> fiml_max_iter: 500
#> fiml_tol: 1e-05
# Every knob supplied explicitly (type = "none"):
estimate_control(type = "none", init_comm = "smc", criterion = 1e-3,
criterion_type = "sum", max_iter = 300, abs_eigen = TRUE)
#> Estimation control (type: "none")
#>
#> init_comm: smc
#> criterion: 0.001
#> criterion_type: sum
#> max_iter: 300
#> abs_eigen: TRUE
#> start_method: psych
#> fiml_max_iter: 500
#> fiml_tol: 1e-05
# Rotation knobs taken from a preset:
rotate_control(type = "psych")
#> Rotation control (type: "psych")
#>
#> normalize: TRUE
#> precision: 1e-05
#> order_type: <from type preset>
#> varimax_type: <from type preset>
#> p_type: <from type preset>
#> k: <from type preset>
#> random_starts: 100
# A criterion-specific extra argument, forwarded to the rotation engine:
rotate_control(type = "EFAtools", k = 3, gam = 0.5)
#> Rotation control (type: "EFAtools")
#>
#> normalize: TRUE
#> precision: 1e-05
#> order_type: <from type preset>
#> varimax_type: <from type preset>
#> p_type: <from type preset>
#> k: 3
#> random_starts: 100
#> extra_args: gam = 0.5