brandmaier / semtree

Recursive Partitioning for Structural Equation Models
https://brandmaier.github.io/semtree/
GNU General Public License v3.0
13 stars 11 forks source link

semtree does not appear to recognise interaction terms in lavaan #63

Open cicadawing opened 7 months ago

cicadawing commented 7 months ago

Hi there!

Love the package Works well for me, except when I specify an interaction term while writing my model in lavaan E.g. lav_obj <- 'y ~ x +z + x:z' run_lav_obj <- sem(model = lav_obj , data = Data)

Above terminates fine. But when I run: tree <- semtree(model=run_lav_obj , data=Data, verbose = T, predictors=c('c'))

I get an error where it looks as though it is searching for the column x:z - which is created in the lavaan object.

brandmaier commented 7 months ago

Thanks for reporting this. I confirm that this is a bug in the current version.