runCFA is a function for performing a one-factor confirmatory factor analysis (CFA) to test unidimensionality.

runCFA(data, estimator = "WLSMV", std.lv = TRUE, scalewise = FALSE, ...)

Arguments

data

a PROsetta_data object. See loadData for loading a dataset.

estimator

the estimator to be used. Passed onto cfa in 'lavaan' package. (default = WLSMV)

std.lv

if TRUE, the metric of the latent variable is determined by fixing their (residual) variances to 1.0. If FALSE, the metric of each latent variable is determined by fixing the factor loading of the first indicator to 1.0. Passed onto cfa. (default = TRUE)

scalewise

if TRUE, run analysis for each instrument as well as for the combined instrument. If FALSE, run analysis only for the combined instrument. (default = FALSE)

...

additional arguments to pass onto cfa.

Value

runCFA returns a list containing the CFA results.

Examples

# \donttest{
out_cfa <- runCFA(data_asq, scalewise = TRUE)
lavaan::summary(out_cfa$`1`       , fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
lavaan::summary(out_cfa$`2`       , fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
lavaan::summary(out_cfa$`combined`, fit.measures = TRUE, standardized = TRUE, estimates = FALSE)
# }