Prints and saves CFA fit, as well as plots CFA factor loadings, simultaneously.
cfa_fit_plot(
model,
data,
covs = FALSE,
estimator = "MLR",
remove.items = "",
print = TRUE,
save.as.pdf = FALSE,
file.name,
...
)The function returns a lavaan fit object. However, it also: prints
a summary of the lavaan fit object to the console, and; prints a
lavaanPlot of the lavaan fit object.
CFA model to fit.
Data set on which to fit the CFA model.
Logical, whether to include covariances on the lavaan plot.
What estimator to use for the CFA.
Optional, if one wants to remove items from the CFA model without having to redefine it completely again.
Logical, whether to print model summary to console.
Logical, whether to save as PDF for a high-resolution, scalable vector graphic quality plot. Defaults to saving to the "/model" subfolder of the working directory. If it doesn't exist, it creates it. Then automatically open the created PDF in the default browser. Defaults to false.
Optional (when save.as.pdf is set to TRUE), if one
wants something different than the default file name.
It saves to pdf per default, so the .pdf extension
should not be specified as it will add it automatically.
Arguments to be passed to function lavaan::cfa.
