I'm attempting to run the following moderated-mediation model in lavaan
Y is an ordinal outcome variable with two levels. Samples are either classified as 0's or 1's. X, M and W are all continuous/numeric. All variables are observed variables.
After having written and run my code, I get the following output with an error:
For search engines, the error is: "Error in lav_data_full(data = data, group = group, cluster = cluster, :
lavaan ERROR: some variables have no values (only missings) or no variance"
Based on the output, the issue looks to be with the third factor, the interaction between W and M - for some reason I cannot understand it is not being indexed in the model.
When I check for missing values and variance estimates on this variable, it shows no missing values and shows that it has substantial variance.
It doesn't matter whether I create this interaction term within lavaan (i.e. "term := W:M") or within R (i.e., "Interaction <- W*M), the same error comes up.
The code I wrote for this can be found here:
Please note that I have intentionally changed the variable names.