Dear researchers, I am trying to assess specific indirect effects in my model with three moderators. However, AMOS always gives a syntax error and my estimand could not run. When I try it on R studio (with lavaan and psych packages), I could not assign parameters to calculate specific indirect effects. Could you please help me identify problems and solutions for this?

Below is the code in R studio:

library(psych)

library(lavaan)

# I already input my CSV data so now I just describe it

describe(my.data)

A =~ A2+ A3 + A4 + A5 + A7 + A8

MS =~ MS1 + MS2 + MS3 + MS4 + MS6 + MS7+ MS8

M =~ M1 + M2 + M4 + MA8

IM =~ IM1 + IM2 + IM3 + IM4

FLA =~ Listen + Speak + Read + Write

# Regression paths from IV to mediators

M ~ a1*IM

A ~ a2*IM

MS ~ a3*IM

# Regression paths from mediators to DV (FLA)

FLA ~ b1*M + b2*A + b3*MS + c1*IM

#From this moment, I tried to assign parameters to calculate specific indirect effects. However, none of the below functions works!

direct : c1

Error: object 'direct' not found

direct:= c1

Error in `:=`(direct, c1) : could not find function ":="

direct

Similar questions and discussions