how can I write indirect and direct effects conditional on moderator, also index of moderated mediation?

17 Views Asked by At

I'm trying to run the attached model in lavaan since I will compare two groups.

structural model will be look like as following If I'm not wrong

model15 <- ' M ~ a.X
           Y ~ c1*X + b1*M + c2*V + b2*VM + c3*VX

If the above code correct, how will I write the indirect and direct effects on moderator levels, also the index of moderated mediation? Does the following code make sense?

conditional indirect := a(b1 + b2)
           conditional direct := c1 + c3*
           total :=  a(b1 + b2) +  c1 + c3
           index.mod.med := a*b2*c3           #Should I add “b2” as well? is the correct calculation multiplication or addiction?
           Vlow := a*b1 + a*b2*c3*-0.5          # If the previous index calculation correct
       Vhigh := a*b1 + a*b2*c3*0.5

If all the above are correct, then whole code will look like as follow

model15 <- ' M ~ a.X
           Y ~ c1*X + b1*M + c2*V + b2*VM + c3*VX
           conditional indirect := a(b1 + b2)
           conditional direct := c1 + c3*V
           total :=  a(b1 + b2) +  c1 + c3
           index.mod.med := a*b2*c3  #Should I add “b2” as well? is the correct calculation multiplication or addiction?
           Vlow := a*b1 + a*b2*c3*-0.5      # If the previous index calculation correct
           Vhigh := a*b1 + a*b2*c3*0.5
           V ~ V.mean * 1
           V ~~ V.var * V
       # Ensure country variable is character
       dat$country <- as.character(dat$country)'
       # Fit the multigroup model
> Model15Sem <- sem(Model15, data = dat, estimator = "MLR", missing = "ML", group = "country")
Model15Sem.constrained <- sem(Model15, data =  dat, estimator = "MLR", missing = "ML", group = "country", group.equal = c("regressions"))

summary(Model15Sem, modindices = TRUE, fit.measures = TRUE, standardized = TRUE)

The main purpose in here is to fit the model correctly and compare it between two countries. In the outpu I cannot get the conditional effects and index. I have been struggling with this for days. I would appreciate any help.

Thanks

I tried to get proper output that include conditional effects and index. but I get several mistakes and in anycase I could not get the conditional effects. so actually I could not write the correct codes. Also, since I couldn't write the proper code, I don't know how to see proportion mediated conditional on moderator

0

There are 0 best solutions below