Hi everyone,
I'd like to model the two models in the figure (among others) and don't get further, so hopefully someone has an idea for me. All data stems from an experimental design, thus it is not possible to change X or Z. For Y, I also have continuous versions of the DV but in simpler models, they did not work as good as the binary DVs. Also, I checked and the problem was not fixed by changing from binary to continuous DV.

Did it work at all?
Yes it did - I provided the code below. But I tried replicating the results of Model 1 using SPSS PROCESS macro and the lavaan output does not show the same results.
Therefore, I am doubting, whether the results of Model 2 are at all correct but I cannot model this in the PROCESS macro because it simply can't do that.
What I guess what the problem is?
A combination of dichotomous IV, moderator and DV as well as the combination of using regression and logistic regression in the same model. The output suggests that the effects are driven by the moderator and not by the interaction as expected and shown using SPSS PROCESS macro.
Specifically, it does not help neither to declare the binary variables as ordered or to declare the binary variables as factors before calculating the interaction. Because then, lavaan simply cannot work with them anymore. Hence, I am not sure, whether it is at all possible to model this with lavaan and whether I should instead switch to MPlus for this.
Code for Model 1:
model_INFmodmed <- '
# Equations
Y ~ con2*1 + cdash*X + b*M2_INF
M2_INF ~ con1*1 + a1*X + a2*Z + az*XZ
# indirect and total effects on Z=0
ab0 := a1*b
total0 := ab0 + cdash
#indirect and total effects on Z=1
ab1 := (a1+az)*b
total1 := ab1 + cdash
# Index of moderated mediation
index := ab0 - ab1
'
fit_INFmodmed <- sem(model_INFmodmed, data = Data)
summary(fit_INFmodmed)
Code for Model 2:
model_seqmodmed <- '
# Equations
Y ~ con1*1 + cdash*X + d*M2_INF
M1_GA ~ con2*1 + a*X
M2_INF ~ con3*1 + b1*M1_GA + b2*Z + bz*M1_GA:Z
# indirect and total effects on Z=0
ab0 := a*b1
total0 := ab0 + cdash
#indirect and total effects on Z=1
ab1 := a*(b1+bz)
total1 := ab1 + cdash
# Index of moderated mediation
index := ab0 - ab1
'
fit_seqmodmed <- sem(model_seqmodmed, data = Data)
summary(fit_seqmodmed)
I hope that someone has an idea, I ran out of ideas to solve this. Thanks a lot in advance!