Get startedGet started for free

Creating CFA syntax from theory

While it's easy to create CFA syntax from EFA results, it's a bit trickier to get the syntax set up when you're working directly from a theory. One way to create syntax that can be used with the sem() function is to create a series of equations showing which item-factor loadings should be estimated. When creating this matrix, the factor names come first, and a colon separates them from a comma-separated list of items. Once you've set up the initial equations, you can use the cfa() function to have the sem package add variances and covariances to the model.

This exercise is part of the course

Factor Analysis in R

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Set up syntax specifying which items load onto each factor
theory_syn_eq <- "
___: A1, A2, A3, A4, A5
___: C1, C2, C3, C4, C5
___: E1, E2, E3, E4, E5
___: N1, N2, N3, N4, N5
___: O1, O2, O3, O4, O5
"
Edit and Run Code