runCFA {PROsetta}R Documentation

Run a confirmatory factor analysis

Description

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

Usage

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 scale as well as for the combined scale. If FALSE, run analysis only for the combined scale. (default = FALSE)

...

additional arguments to pass onto cfa.

Value

runCFA returns a list containing the CFA results.

Examples


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)


[Package PROsetta version 0.3.5 Index]