Fits a single factor (congeneric by default) confirmatory factor
analysis model to raw item data or a sample covariance matrix. This
is the one factor special case of cfa_k: the function
is a convenience wrapper that only requires the data (and, when the
data hold more than the items, a vector of item names), builds the
one factor specification, and forwards everything else to
cfa_k(). The factor is named f1, so the rows of the
returned table are lambda_f1_1, lambda_f1_2, ...,
psi_f1_1, ..., and omega_f1, exactly as a one factor
cfa_k() call would report them (the syntax column
names the item behind each number).
cfa_1(
data = NULL,
items = NULL,
S = NULL,
N = NULL,
equal_loading = FALSE,
equal_error = FALSE,
estimator = "ML",
missing = "listwise",
se = "standard",
conf_level = 0.95,
output = c("verbose", "measurement", "summary", "standardized", "fit"),
...
)The value of the corresponding cfa_k call: a
data.frame (classes dmar_cfa_k, dmar_tbl) with
one row per parameter (estimate, se, z_value,
p_value, ci_lower, ci_upper) followed by the
fit rows, or the alternative shapes selected by output
(see ?cfa_k).
A raw data matrix or data frame, rows are respondents and
columns include the items. A matrix without column names is given
the names y1, y2, ... Supply exactly one of
data or S.
Character vector naming the items of the factor (three
or more; two are accepted with equal_loading = TRUE, the
just identified tau-equivalent case). The default NULL uses every column of data
(or of S), so a data set that holds only the items needs no
items at all.
A symmetric covariance matrix of the items; N is then
required. Dimnames are optional here: a matrix without them is
given the item names y1, y2, ... Supply exactly one
of data or S.
Total sample size. Required with S; ignored (inferred
from the rows) with data.
Logical, or a named logical vector with one
element per factor. TRUE constrains the loadings within a
factor to a single value (across factors nothing is equated).
Defaults to FALSE.
Logical, or a named logical vector with one element
per factor. TRUE constrains the error variances within a
factor to a single value. Defaults to FALSE.
Character; estimator passed to lavaan. Must be
one of "ML" (default; maximum likelihood, fully efficient
under multivariate normality), "MLR" (robust maximum
likelihood: maximum likelihood estimates with standard errors and
test statistic corrected for nonnormality; Satorra & Bentler,
1994), "WLS" (the asymptotic distribution free estimator of
Browne, 1984; raw data and a large sample required),
"WLSMV" (diagonally weighted least squares with mean- and
variance-adjusted test statistic; Muthén, 1984; Muthén, du Toit, &
Spisic, 1997; the standard choice for ordered categorical items,
and what ordered switches to), or "GLS"
(generalized least squares; Browne, 1974). With a robust estimator
the reported fit indices are the robust versions.
Character; missing-data handling passed to lavaan
when raw data are supplied. Common values are "listwise"
(default, listwise deletion) and "ml" (full information
maximum likelihood). Ignored with S.
With ordered items, "ml"/"fiml" are not
available; use "pairwise" or "listwise".
Standard error type passed to lavaan; see
cfa. Common values are "standard"
(default), "robust.sem" (with estimator = "MLR"), and
"none" (point estimates only; fastest).
Confidence level for the parameter confidence intervals, including the delta method intervals for omega, AVE, and H. Defaults to 0.95. The RMSEA interval is a separate convention (see Details).
Format of the returned object:
"verbose"(default) Parameter estimates with
confidence intervals, the per-factor defined parameters
(loading_sum, error_sum, omega, ave,
H), and fit information.
"measurement"The measurement-property rows only:
per factor omega, ave, and H (with delta
method standard errors and confidence intervals), the latent
correlation phi for every factor pair (with its
confidence interval), and, for raw data, the
heterotrait-monotrait ratio htmt for every factor pair
via htmt.
"summary"The raw summary() output from
lavaan (not a data frame).
"standardized"The standardized parameter estimates
from lavaan::standardizedSolution().
"fit"The raw lavaan fit object. Escape hatch
for direct lavaan access, including likelihood ratio tests
between two cfa_k() fits via
lavaan::lavTestLRT().
Additional arguments forwarded to cfa_k
and, through it, to lavaan.
Ken Kelley [email protected]
The model is identified by fixing the factor variance to 1 and
estimating every loading. equal_loading and equal_error
impose the classical measurement structures on the single factor, and
the header of the printed table names the structure implied by the
constraints. For the composite reliability coefficient with the
observed total variance in the denominator, use
reliability_omega with denominator = "observed";
for the model implied omega, the omega_f1 row of this
function's output and reliability_omega agree.
Ordered categorical items are not supported here; use
cfa_k, whose ordered argument fits WLSMV with
the theta parameterization and reports the Green and Yang (2009)
categorical sum score omega, or
reliability_omega_categorical.
Green, S. B., & Yang, Y. (2009). Reliability of summed item scores using structural equation modeling: An alternative to coefficient alpha. Psychometrika, 74(1), 155--167. tools:::Rd_expr_doi("10.1007/s11336-008-9099-3")
Kelley, K., & Pornprasertmanit, S. (2016). Confidence intervals for population reliability coefficients: Evaluation of methods, recommendations, and software for composite measures. Psychological Methods, 21(1), 69--92. tools:::Rd_expr_doi("10.1037/a0040086")
McDonald, R. P. (1999). Test theory: A unified treatment. Lawrence Erlbaum Associates.
cfa_k for the general function this wraps
(factor analysis with any number of factors, intercept constraints,
ordered categorical items, and the measurement output);
cfa_2 for the two factor wrapper;
reliability_omega for coefficient omega with
confidence intervals.
Other multivariate and latent variable methods:
average_variance_extracted(),
bifactor_indices(),
cfa_2(),
cfa_k(),
ci_eigenvalue(),
common_method_marker(),
common_method_single_factor(),
dmacs(),
ecvi(),
htmt(),
irt_grm(),
irt_information(),
measurement_alignment(),
measurement_invariance(),
procrustes_phi(),
simple_structure()
set.seed(113)
f <- rnorm(200)
loadings <- c(0.5, 0.6, 0.65, 0.7, 0.8)
X <- sapply(loadings, function(l) l * f + rnorm(200, sd = sqrt(1 - l^2)))
colnames(X) <- paste0("y", 1:5)
# All columns are items, so the data are all that is needed.
cfa_1(X)
# Equal loadings (essentially tau-equivalent), named in the header.
cfa_1(X, equal_loading = TRUE)
# From a covariance matrix and sample size, as a paper reports them.
cfa_1(S = cov(X), N = 200)
# A subset of columns via \'items\'.
cfa_1(X, items = c("y1", "y2", "y3", "y4"))
Run the code above in your browser using DataLab