user6121484
user6121484

Reputation: 143

Lavaan: how to specify interaction terms in SEM

I am using lavaan and have only observed variables (no latent variables). I would like to include an interaction term in the model, but not sure how to do this.

This is what I have

model4 <-'
interac =~ var1 * var2
Ent ~ age
presu ~ age + interac
protein ~ age + fat
fat ~ age
tempo ~ age +interac+protein
score ~sex+education+presu+tempo
'
fit <- sem(model4, data=mydata)
summary(fit4, fit.measures=TRUE)

(all variables have been scaled before starting, because I had some issues with some variables being 100 times larger than others).

I am wondering whether this is correct? I don't have the main effects of the interaction in the regression? Shouldn't these be included? When I add the interaction term directly in the regression (var1*var2), I get 1 as estimates, so that must be wrong...

Upvotes: 3

Views: 8022

Answers (1)

Sinval
Sinval

Reputation: 1417

No, it is not correct. For manifest variables interaction, you have two alternatives:

1 - create the interaction term outside lavaan, e.g.:

mydata$interac <- mydata$var1 * mydata$var2

or

2 - use the : operator:

model4 <-'

Ent ~ age
presu ~ age + var1:var2 #interaction and age as predictors
protein ~ age + fat
fat ~ age
tempo ~ age + var1:var2 + protein #interaction, age and protein as predictors
score ~sex+education+presu+tempo
'
fit <- sem(model4, data=mydata)
summary(fit4, fit.measures=TRUE)

Upvotes: 2

Related Questions