Error in plsm... manifest variables must be contained in data

259 views Asked by At

I am trying to make a PLS-SEM model and I am using the plsm() function in R from the semPLS package. However, at first I got an error saying:

The latent variables are not allowed to coincide with names of observed variables.

I understood it, but after going through my input and even in my measurement model matrix adding single-factor constructs (directly measured variables) I now get the following:

mod <- plsm(data = survey, strucmod = smin, measuremod = mmin)
Error in plsm(data = survey, strucmod = smin, measuremod = mmin) : 
  The manifest variables must be contained in the data.

I am at a loss as to how I should proceed. It seems that whenever I "fix" one problem, it directly causes another. Does anyone have any examples aside from the standard mobi example from the package where I could see how it's done when I have both latent and directly measured variables?

Found the code for the function, but now I'm even more confused. https://github.com/cran/semPLS/blob/master/R/plsm.R

Could anyone explain in a simple manner how I am supposed to name my df columns, and the measurement model to avoid this problem?

1

There are 1 answers

0
Andrew Martinez On

don't know if you ever solved this, but i just had a similar issue, and seemed to be the only other person. i ended up getting this solved through some trial and error.

I created three tables:

structmodel: SM - column names:       Source|Target
measurement model: MM - Column names: Source|Target
Data: Column names -                  Measurement headers

I converted the sm and mm tables to a matrix

datamatrix_SM = as.matrix(SM)
datamatrix_MM = as.matrix(MM)