Skip to content
Discussion options

You must be logged in to vote

Hi,

In general, the LMS approach is only implemented for models with all continuous data. There are available options for handling categorical binary variables, treating them as functions of latent response variables, but this doesn't always make sense for exogenous/independent variables.

When we have an interaction between a latent variable and a binary categorical variable, it is often more practical to measure the interaction effect via a (linear) multigroup model. Consider this hypothetical model, where we have an interaction between sex and X on Y

library(lavaan)
library(modsem)

# here we just create some toy data from the oneInt dataset
data <- oneInt
data$sex <- as.integer(oneInt$z1 

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@Kss2k
Comment options

@maria-jal
Comment options

@Kss2k
Comment options

@maria-jal
Comment options

@Kss2k
Comment options

Kss2k Jun 1, 2026
Maintainer

Answer selected by maria-jal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants