I’d delete my comment because it’s such a silly mistake, but maybe others will make similar mistakes. Thanks!

This is the code without the effect of C that I ended up using:

myModel <- '

Y ~ b1 * M1 + b2 * M2 + c1 * X1 + c2 * X2

M1 ~ a1 * X1 + a2 * X2

M2 ~ a3 * X1 + a4 * X2

#indirect effects

indirect1 := a1 * b1

indirect2 := a3 * b2

indirect3 := a2 * b1

indirect4 := a4 * b2

# contrasts

con1 := a1 * b1 – a3 * b2

con2 := a2 * b1 – a4 * b2

con3 := (a1-a2) * b1

con4 := (a3-a4) * b2

# total effect

total1 := c1 + (a1 * b1) + (a3 * b2)

total2 := c2 + (a2 * b1) + (a4 * b2)

# covariates

M1 ~~ M2

'

LikeLike

]]>“Error in lav_data_full(data = data, group = group, cluster = cluster, :

lavaan ERROR: missing observed variables in dataset: c3 a5 a6”

Do you have any idea what this error could be? Thanks very much!

LikeLike

]]>How would you specify the correct error term for the logistic regression?

LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>LikeLike

]]>