Fit an exploratory factor analysis in each of several groups at a common
number of factors and bring the per-group solutions into one shared
orientation so their loadings can be compared. Each group is fitted with
efa_fit(); the solutions are then aligned either to a symmetric consensus target
or to a chosen reference group (see Alignment).
efa_group(
x,
groups = NULL,
n_factors,
N = NA,
reference_group = NULL,
b_boot = 0L,
ci = 0.95,
seed = NULL,
delta = 0.1,
invariance = FALSE,
...
)An object of class efa_group, a list containing:
A named list of the aligned per-group loading matrices. Their
columns match the columns of target in order and sign.
The alignment target: the symmetric consensus target, or the reference group's own loadings.
A named list of the aligned per-group factor intercorrelations for
an oblique rotation; NULL otherwise.
Tucker congruence between the aligned group loadings, a list
with: matrices, a nested list whose [[g]][[h]] element is the
factor-by-factor congruence matrix between the aligned loadings of groups
g and h; matched, a groups-by-groups-by-factors array of the
matched-factor congruences (the diagonal of each pairwise matrix); and
degenerate, a groups-by-groups logical matrix flagging pairs whose
congruence is undefined (for example, a near-zero factor), for which the
corresponding entries are NA. When b_boot > 0 (raw data), three further
elements are added: matched_se, the bootstrap standard error of each
matched congruence; matched_ci, a list of lower and upper percentile
confidence limits (each a groups-by-groups-by-factors array); and n_boot,
the number of bootstrap replicates the intervals are based on.
A data frame with one row per group pair summarising the differences
between their aligned loadings: the mean, median, minimum, and maximum absolute
difference, the root-mean-square difference (rmse), and n_flagged, the number of
loading cells whose absolute difference reaches delta.
A data frame with one row per group pair, item, and factor giving the signed
loading difference (diff), its absolute value (abs_diff), and flagged, whether it
reaches delta. When a bootstrap was run (b_boot > 0, raw data), ci_lower,
ci_upper, and ci_excludes_0 add the percentile confidence interval for the
difference and whether it excludes zero; otherwise these are NA.
When invariance = TRUE, a data frame with one row per group pair and
factor giving the matched Tucker congruence (phi), its bootstrap CI lower bound
(phi_lower, NA without a bootstrap), and an approximate-invariance verdict based on
the Lorenzo-Seva and ten Berge (2006) similarity bands: phi >= 0.95 is "equal" and
[0.85, 0.95) is "fair"; congruences < 0.85, below their bands, are labelled
"incongruent". The verdict is read from phi_lower when a bootstrap is available
(conservative) and from phi otherwise. NULL when invariance = FALSE.
The named list of per-group efa_fit() objects (each retains its own
diagnostics, e.g. heywood).
The alignment result: the consensus object (see
efa_procrustes()), or a list with the reference group, the target, and the
per-group Procrustes results. On the consensus path this is the raw record of
the Generalized Procrustes iteration, so its target and aligned_loadings
are in the orientation that iteration converged to, before the gauge described
under Alignment is applied; the gauged matrices are target and loadings
above.
A list of the settings used, including the per-group N, the
alignment method, the group that seeded the consensus frame (alignment_start,
NULL on the reference path), the orientation the shared frame was put in
(gauge: the rotation's own name, "principal_axes", or "identity" for a
single factor; NULL on the reference path), the rotation, the estimator, the
input type, and whether a bootstrap is available (can_bootstrap, FALSE for
correlation-matrix input).
A data frame or matrix of raw data (with groups), or a named list
of per-group data sets -- either raw data frames/matrices or correlation
matrices (all of one kind).
A vector with one value per row of x, giving each row's group.
Only used when x is a single raw data set; leave NULL when x is a list.
Rows with a missing group value are dropped with a warning.
numeric. The common number of factors extracted in every group.
numeric. The number of observations per group, used only for
correlation-matrix input: either a single value applied to all groups or one
value per group. Ignored for raw data, where N is taken from each group's
data. Default is NA.
The group to align the others to (a group name or an
integer index). If NULL (default), orthogonal and unrotated solutions use
the symmetric consensus target; oblique solutions fall back to the first
group as reference. Supplying a value forces the reference alignment.
numeric. The number of non-parametric bootstrap replicates used to
form percentile confidence intervals for the between-group Tucker congruences.
0 (the default) skips the bootstrap and returns the congruence point estimates
only. Bootstrapping requires raw data; it is skipped with a warning for
correlation-matrix input.
numeric. The confidence level for the bootstrap congruence intervals, a
single value in (0, 1). Default is 0.95.
numeric or NULL. An optional seed making the analysis reproducible. It
covers the per-group fits -- whose rotation may draw random starts -- whether or not
a bootstrap is run, and additionally makes the bootstrap independent of the number of
parallel workers (the replicate fits run with
future_lapply(), for which a parallel plan can be
set via future::plan()). When supplied, the caller's random-number stream is
restored afterwards, leaving no side effect. Default is NULL.
numeric. The salience threshold for the per-item loading-difference flag
table: an item's loading on a factor is flagged for a group pair when the groups'
aligned loadings differ by at least delta in absolute value. This is a descriptive
salience heuristic, not a significance test; common alternatives are 0.15 and 0.20.
The threshold applies to whatever loading metric the chosen rotation produces (pattern
coefficients for an oblique rotation). 0 flags every cell. Default is 0.1.
logical. Whether to add an approximate-invariance verdict per factor and
group pair from the Lorenzo-Seva and ten Berge (2006) congruence bands (see Value).
Default is FALSE.
Additional arguments passed to efa_fit() for every group (for
example estimator, rotation, cor_method, or an estimate_control() /
rotate_control() to select a preset).
Groups can be supplied in two ways: raw data together with a grouping vector
(x a data frame or matrix, groups one value per row), or a named list of
per-group data sets in x (with groups left NULL). The list may hold raw
data frames or correlation matrices (supply N), but not a mix of the two.
All groups must contain the same items in the same order; a different item set
or order is an error rather than being silently reordered.
Every group is fitted at the same n_factors (a common-\(k\) multigroup
model). Extra arguments in ... (for example estimator, rotation, cor_method, or an
estimate_control() / rotate_control() carrying the tuning knobs) are forwarded
unchanged to each efa_fit() call, so the estimator and rotation are common to all
groups.
The \(k\)-factor model must be identified for the shared item set: its
degrees of freedom \(((p - k)^2 - (p + k)) / 2\) must be non-negative. Unlike
a single efa_fit() fit -- which only warns on an under-identified model -- a
multigroup fit aborts, because a shared alignment target across an
under-identified group is not interpretable.
A factor solution is identified only up to a rotation of its factors, so the per-group solutions must be brought into a common orientation before their loadings can be compared. Two strategies are available and are chosen automatically:
Consensus (the default for orthogonal rotations and for unrotated
solutions): a symmetric Generalized Procrustes Analysis target is built
across all groups (Gower, 1975), and every group's loadings are rotated to
it. The consensus frame is only identified up to a global rotation of its
factors, so it is then rotated into a fixed gauge and the same transform is
applied to every group. The gauge is the simple structure of the rotation
that was requested, evaluated on the consensus target itself, so the shared
loadings are in the same kind of frame as the per-group solutions they
summarise. Where no criterion identifies a frame -- an unrotated solution,
and a "bifactorT" request with two factors, whose criterion is identically
zero with a single group factor -- the principal-axes orientation of the
target is used instead. Either way the columns are ordered by decreasing sum
of squares and signed by their column sums, and the shared orientation, and
hence every reported congruence, difference, and flag, is independent of the
order in which the groups are supplied.
Reference: every group's loadings are aligned by Procrustes rotation to
one reference group's loadings, which are kept fixed. This path is used when
reference_group is given, and is used automatically for oblique rotations
because the consensus iteration is not defined for oblique transforms with
more than one factor. When an oblique rotation triggers the reference path
without an explicit reference_group, the first group is used and a message
reports this; the requested rotation is never silently changed.
In both cases the returned per-group loadings share the column order and sign
of the returned target.
Because the per-group loadings share one orientation, they can be compared cell by cell.
efa_group() reports a per-pair summary of their differences (diffs) and a per-item,
per-factor flag table (flags) marking cells whose absolute difference reaches delta.
delta is a descriptive salience heuristic, not a significance test; a bootstrap
(b_boot > 0) additionally reports whether each difference's confidence interval excludes
zero. With invariance = TRUE, a per-factor verdict grades the matched Tucker congruence
by the Lorenzo-Seva and ten Berge (2006) similarity bands -- "equal" (>= .95) and "fair"
([.85, .95)) -- labelling weaker congruences "incongruent"; when a bootstrap is available
the verdict uses the congruence CI lower bound, so a factor is judged "equal" only if even
the lower bound clears the band.
Efron, B., & Tibshirani, R. J. (1993). An Introduction to the Bootstrap. Chapman & Hall.
Gower, J. C. (1975). Generalized Procrustes analysis. Psychometrika, 40, 33-51. doi: 10.1007/BF02291478
Lorenzo-Seva, U., and ten Berge, J. M. F. (2006). Tucker's congruence coefficient as a meaningful index of factor similarity. Methodology, 2, 57-64. doi: 10.1027/1614-2241.2.2.57
Other factor analysis:
efa_average(),
efa_fit(),
efa_mi(),
plot.efa_group(),
print.efa_group()
# Raw data split by a grouping vector (unrotated, consensus alignment)
g <- rep(c("g1", "g2"), length.out = nrow(GRiPS_raw))
mg <- efa_group(GRiPS_raw, groups = g, n_factors = 1)
mg$loadings
# Per-pair difference summary and the per-item salience-flag table
mg$diffs
mg$flags
# \donttest{
# Percentile bootstrap confidence intervals for the between-group congruences, with an
# approximate-invariance verdict read conservatively off the congruence CI lower bound
mg_ci <- efa_group(GRiPS_raw, groups = g, n_factors = 1, b_boot = 100, seed = 42,
invariance = TRUE)
mg_ci$congruence$matched_ci
mg_ci$invariance
# A named list of correlation matrices sharing the same items, common
# three-factor model, orthogonal rotation -> symmetric consensus target
bands <- list(age_6_8 = WJIV_ages_6_8$cormat, age_14_19 = WJIV_ages_14_19$cormat)
Ns <- c(WJIV_ages_6_8$N, WJIV_ages_14_19$N)
efa_group(bands, n_factors = 3, N = Ns, rotation = "varimax")
# An oblique rotation aligns to a reference group (reported via a message)
efa_group(bands, n_factors = 3, N = Ns, rotation = "promax")
# }
Run the code above in your browser using DataLab