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

Problem with estimate_pls I got an Error #328

Open
caterinagf opened this issue Apr 9, 2023 · 4 comments
Open

Problem with estimate_pls I got an Error #328

caterinagf opened this issue Apr 9, 2023 · 4 comments

Comments

@caterinagf
Copy link

I'm doing modeling, but I can't use the estimate_pls function, it returns an error.
in data[, all_loc_non_int_items(measurement_model)]:
Can't subset columns with all_loc_non_int_items(measurement_model).
Subscript all_loc_non_int_items(measurement_model) must be a simple vector, not a matrix.

Here is my code;
#Compile measurement model
mm_IMC = constructs(
composite("USBLT", multi_items("USBLT", 1:3)),
composite("USEFS", multi_items("USEFS", 4:6)),
composite("TRST", multi_items("TRST", 7:9)),
composite("PRSN", multi_items("PRSN", 10:12)),
composite("SATIS", multi_items("SATIS", 13:15)),
composite("PINTN", multi_items("PINTN", 16:18))
)

#Build structural model
sm_IMC = relationships(
paths(from = c("USBLT"), to = c("SATIS")),
paths(from = c("USEFS"), to = c("SATIS")),
paths(from = c("TRST"), to = c("SATIS")),
paths(from = c("PRSN"), to = c("SATIS")),
paths(from = c("SATIS"), to = c("PINTN"))
)

#Estimate the model
IMCmod_est = estimate_pls(
data = data_sem,
measurement_model = mm_IMC,
structural_model = sm_IMC,
missing = mean_replacement,
missing_value = NA
)

Could you help me with this problem?

With respect,
Kate

@soumyaray
Copy link
Contributor

Hi Kate,

Could you start with the simplest model possible (comment out all the constructs except for two of them – e.g., USBLT and SATIS) from both measurement and structural models and see if it estimates? If it works, keep adding constructs one-by-one until you find which one is causing the error?

@caterinagf
Copy link
Author

I tried to run model for two factors. It doesn't work.
The same error
#Compile measurement model
mm_IMC = constructs(
composite("USBLT", multi_items("USBLT", 1:3)),
composite("SATIS", multi_items("SATIS", 13:15))
)

#Build structural model
sm_IMC = relationships(
paths(from = c("USBLT"), to = c("SATIS"))
)

#Estimate the model
IMCmod_est = estimate_pls(
data = data_sem,
measurement_model = mm_IMC,
structural_model = sm_IMC,
missing = mean_replacement,
missing_value = NA
)

@pfrombris
Copy link

pfrombris commented Jul 13, 2023

I have found exactly the same error message with estimate_pls() and I have reduced my model to the absolute minimum and it still happens. seminr v2.3.1, r version 4.2.3. Can anyone help please?

@RanaAvinash
Copy link

Convert data to csv format before importing into R.

I encountered the same issue and resolved using this method

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

4 participants