Hello there,
The basic model produces no error. However, for complexity reduction, I want to constrain the model for "Time-invariant standardized lagged effects" (syntax by clicking on the folder after "The RI-CLPM") produces the following error message:
Error in lav_partable_constraints_def(partable, con = LIST, debug = debug) :
lavaan ERROR: unknown label(s) in variable definition(s): a c b d
However, I had to do some adaptations to my model syntax, because unlike Moulder's & Hamaker's syntax, I have only four measurement time points (my syntax is below and data is attached).
My adaptation procedure was such that I deleted any line that referred to a variable at t5.
The error message refers probably to the lower two batches of code, in which "
correlations of within-components" are computed and "
residual variances of within-components" are constrained.
In there, the ":=" operator ought to define additional parameters (a, b, c, d), but this does not work, as the error message tells.
Maybe one needs fewer additional parameters for four time points?
I would be very happy for any thoughts about this :)
best regards,
Korbinian
My adapted syntax is as follows:
RICLPM <- '
# Create within-components with freely estimated factor loading
wx1 =~ NA*x1
wx2 =~ NA*x2
wx3 =~ NA*x3
wx4 =~ NA*x4
wy1 =~ NA*x1
wy2 =~ NA*x2
wy3 =~ NA*x3
wy4 =~ NA*x4
# Set variances of within-components at first wave to 1
wx1 ~~ 1*wx1
wy1 ~~ 1*wy1
# Estimate correlation between within-components at first wave
wx1 ~~ cor1*wy1
# Label the residual covariances
wx2 ~~ rcov2*wy2
wx3 ~~ rcov3*wy3
wx4 ~~ rcov4*wy4
# Label the residual variances
wx2 ~~ rvx2*wx2
wy2 ~~ rvy2*wy2
wx3 ~~ rvx3*wx3
wy3 ~~ rvy3*wy3
wx4 ~~ rvx4*wx4
wy4 ~~ rvy4*wy4
# Compute correlations of within-components at each wave
cor2 := a*c + b*d + a*d*cor1 + b*c*cor1 + rcov2
cor3 := a*c + b*d + a*d*cor2 + b*c*cor2 + rcov3
#! Contrain residual variances of within-components such that variance of each within-component equals 1
rvx2 == 1 - (a*a + b*b + 2*a*b*cor1)
rvy2 == 1 - (c*c + d*d + 2*c*d*cor1)
rvx3 == 1 - (a*a + b*b + 2*a*b*cor2)
rvy3 == 1 - (c*c + d*d + 2*c*d*cor2)
rvx4 == 1 - (a*a + b*b + 2*a*b*cor3)
rvy4 == 1 - (c*c + d*d + 2*c*d*cor3)
'
RICLPM.fit <- lavaan(RICLPM, data = ep_pr, missing = 'ML', meanstructure = T, int.ov.free = T)
summary(RICLPM.fit, standardized = T)