How to include a latent factor residual / disturbance term in lavaan?

133 Views Asked by At

Sample code:

library(lavaan)
model <- '
#latent variable definition
visual =~ x1 + x2 + x3

#regressions
visual ~ x4
visual ~ x5
visual ~ x6

#(co)variances
visual ~~ visual
'

fit <- sem(model, data = HolzingerSwineford1939)
summary(fit)
inspect(fit,"estimates")

Because I believe that not all variance of visual is explained by x4, x5, and x6, I want to make sure a latent factor residual (disturbance term) is included to represent the remainder of the variance found in visual.

I've included the following code in an attempt to include residual variance of the latent variable: visual ~~ visual, but I'm pretty sure this simply represents the variance, not the residual variance, and is therefore redundant.

Under the "variances:" heading in the output from summary(fit) the estimate obtained for visual is 0.608. When visual ~~ visual is removed from the code, I get the exact same value.

Under the "$psi" heading in the output from the function inspect(fit,"estimates") the intersection of visual with itself yields an identical value: 0.608. When visual ~~ visual is removed, again I get the same result.

I believe both of these values are estimates of the total variance of visual, not the residual variance. So how is the estimate of residual variance of visual obtained?

In the lavaan tutorial, it says "residual variances are added automatically", but I believe this may be referring only to residual variances of observed variables, not to the residual variances of latent variables.

0

There are 0 best solutions below