How to define CFA with error terms as sums of exogenous correlations?

I’m working on a complex CFA model in R using lavaan. The tricky part is setting up the error terms for observed variables. Each error should equal the sum of two specific correlations between unique items.

For example, the error for y1,2 should be the sum of its covariance with y1,3 and y*2,3.

Here’s a snippet of my current lavaan code:

cfa_model <- '
  C =~ C1_12*i1i2 + C1_13*i1i3 + C2_12*i4i5 + C2_13*i4i6 + C3_12*i7i8 + C3_13*i7i9
  R =~ R1_12*i1i2 + R1_23*i2i3 + R2_12*i4i5 + R2_23*i5i6 + R3_12*i7i8 + R3_23*i8i9
  O =~ O1_13*i1i3 + O1_23*i2i3 + O2_13*i4i6 + O2_23*i5i6 + O3_13*i7i9 + O3_23*i8i9

  # Other constraints and covariances...

  i1i2~~i1i3
  i1i2~~i2i3
  i1i3~~i2i3
'

How can I set the error term for each item to be the sum of its related covariances? Is there a way to do this in lavaan syntax?

Hey Emma_Brave! That’s a really interesting CFA model you’re working on. I’m curious about why you need to define the error terms as sums of specific correlations. Is this related to some unique characteristic of your data or research question?

Your lavaan syntax looks pretty solid so far. For the error term setup you’re describing, you might need to use some custom constraints. Have you tried something like this?

# Add to your existing model
i1i2 ~~ a*i1i3 + b*i2i3
i1i2 ~~ a + b

# Repeat for other items

This defines the error variance of i1i2 as the sum of its covariances with i1i3 and i2i3. You’d need to do this for each item.

But I’m wondering - have you considered using modification indices to identify significant error covariances instead? It might be a bit more flexible.

What made you choose this specific approach for error terms? I’d love to hear more about your thought process!

I’ve encountered similar challenges with complex CFA models in lavaan. One approach that might work for your situation is using phantom variables to represent the error terms. Here’s a potential modification to your syntax:

cfa_model <- '
  # Your existing factor structure

  # Phantom variables for error terms
  e1i2 =~ 0*i1i2
  e1i3 =~ 0*i1i3
  e2i3 =~ 0*i2i3

  # Set error variances as sums of covariances
  i1i2 ~~ e1i2 + e1i3
  i1i3 ~~ e1i2 + e2i3
  i2i3 ~~ e1i3 + e2i3

  # Constrain phantom variances to zero
  e1i2 ~~ 0*e1i2
  e1i3 ~~ 0*e1i3
  e2i3 ~~ 0*e2i3
'

This method allows you to explicitly define error terms as sums of covariances. You’d need to repeat this structure for each set of items. It’s a bit verbose, but it gives you precise control over the error structure. Have you tried anything like this approach before?

hey emma, that’s a tricky setup! have u tried using equality constraints? something like:

i1i2 ~~ e1
i1i3 ~~ e2
i2i3 ~~ e3
e1 == e2 + e3

this forces the error for i1i2 to equal the sum of the other two. might need to play around with it, but could work? lemme know if u try it!