Get startedGet started for free

Understanding the sem() syntax

1. Understanding the sem() syntax

In the previous exercises, you set up syntax for running a CFA using the sem() function. Let's take a look at some of the parts that go into that syntax.

2. Relationships between variables and factors

If you take a look at what the cfa() function created from your initial input of factors, one of the first things you'll see is syntax expressing the relationships between the factors and the variables that map to them. You'll see three columns of information for each estimated parameter. First, you see the relationship as expressed by a directional path arrow. Notice the direction of the arrows in the relationships - the relationships go from the factors to the items. This is because in the theory underlying factor analyses, the examinees' levels of the latent traits predict their responses on individual items. This is a little counterintuitive at first, but it's important to understand how the analyses work on a conceptual level. Next, the Parameter column contains a name that is automatically assigned to each parameter - lam stands for lambda, which is common notation for these relationships. Finally, there's a starting value to be used in estimation. The StartValue column is blank here because the starting values weren't specified. If you have hypothesized or previously estimated values, you could specify them here to speed up estimation. It's fine not to specify them, though - the sem() function will randomly choose starting values.

3. Factor variances

Another type of relationship you'll see in the syntax is factor variances. You'll notice that these are expressed with bidirectional arrows. In order to make the model estimable, these values are fixed, so you'll see they don't get parameter names. The StartValue is 1 because these parameter values are fixed at 1.

4. Factor covariances

The relationships between the latent factors are also included in the model as factor covariances, which are also assigned bidirectional arrows. Their parameter names feature a C for covariance followed by brackets enclosing the two factors that covary. When factors covary, it means that respondents' levels of those factors are related, so the factors are probably also theoretically linked as well.

5. Item variances

Finally, you'll see the item-level variances expressed in the syntax. These are also bidirectional arrows, and parameter names are assigned with a V for variance followed by the item name within brackets.

6. Running the CFA

Hopefully, you now have a bit better understanding of the syntax that goes into a CFA. Good news: actually running the CFA is way easier than understanding the syntax! All you have to do is plug in your syntax object and your dataset into the sem() function.

7. Interpreting the output

When you use the summary() function on the CFA results object, you get similar output to what you got from an EFA. You can see the fit statistics at the top, followed by information about residuals. Below that, there are r-square values for the observed variables. These give you information about how much of the variance in the latent factor each item is capable of explaining. Finally, you get the parameter estimates. These include unstandardized regression coefficients from each item/factor relationship, standard errors, Z-values and their corresponding p-values, and the path representation of the relationship.

8. Let's practice!

Now you've got an understanding of the syntax underlying a CFA, you've seen how easy it is to run a CFA once you've got the syntax set up, and you've taken a look at the resulting output. Let's go practice all these new skills!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.