High order interactions in R lavaan

Viewed 495

I'm trying to estimate models with three-way interactions in R lavaan using the syntax terms operator : (which works fine with two-way interactions). It seems that lavaan ignores the three-way interaction.

To reproduce the problem, one can use

library(lavaan)
f1<-"y~x1+x2+x3+x1:x2+x2:x3+x1:x2:x3"
lavParseModelString(f1)

$rhs
[1] "x1"    "x2"    "x3"    "x1:x2" "x2:x3"

Am I missing something?

1 Answers

I have only used Lavaan a few times, but have you tried to create the interaction term and inserting it into the model? I am assuming these are observed variables because the ":" works for observed but not latent variables. i.e.,

interaction <- x1*x2*x3

f1 <- "y ~ x1 + x2 + x3 + x1:x2 + x2:x3 + interaction"

I do not know why the ":" does not work for three way interactions. Also, good luck interpreting your three-way interaction!

Related