Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems when trying to select particular elements of a factor, when the formative model argument (mode_B) is included #345

Open
samirnemechaves opened this issue Jan 25, 2024 · 0 comments

Comments

@samirnemechaves
Copy link

Hi, community, I trying to create the next measure model, however, I have noticed that when I include the "ATENCION" factor where I want to select particular items (1,3,4), and also after that I include the training model argument (mode_B). When I want to create the measurement model I get the following error when running code:

"Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class ‘"function"’ to a data.frame. Below the script"

#PLS-PM
library(seminr)
library(dplyr)
DF <- dplyr::select(PNN, 8:33)

#MM
ENG_mm <-constructs(
composite("IDENT",multi_items("Idt,1:3), weights = mode_B),
composite("ENTUS",multi_items("Ent",1:2), weights = mode_B),
composite("ATENCION",multi_items("Ate", c(1,3,4), weights = mode_B))
)

Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class ‘"function"’ to a data.frame

To try to identify the errors I have been creating factor by factor and everything is fine before reaching the "ATENCION" factor, I have seen that if I remove the selection of specific items leaving all items from 1 to 4 "1:4" ( see example script 2) the measurement model is created without problem, or on the other hand, if I leave the specific selection of items "c(1,3,4)" but remove the reflective mode argument (mode_B) is also normally created (see example script 3) .

I appreciate your help to be able to carry out the creation of the first measurement model

#Examples to scripts without problems

#script2

ENG_mm <-constructs(
composite("IDENT",multi_items("Idt,1:3), weights = mode_B),
composite("ENTUS",multi_items("Ent",1:2), weights = mode_B),
composite("ATENCION",multi_items("Ate", c(1,3,4)))
)

#Script3

ENG_mm <-constructs(
composite("IDENT",multi_items("Idt,1:3), weights = mode_B),
composite("ENTUS",multi_items("Ent",1:2), weights = mode_B),
composite("ATENCION",multi_items("Ate", 1:4), weights = mode_B))
)

@samirnemechaves samirnemechaves changed the title problems when trying to select particular items from a factor problems when trying to select particular elements of a factor, when the formative model argument (mode_B) is included Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant