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

Third-order construct not running #321

Open
zizzo opened this issue Jan 10, 2023 · 6 comments
Open

Third-order construct not running #321

zizzo opened this issue Jan 10, 2023 · 6 comments

Comments

@zizzo
Copy link

zizzo commented Jan 10, 2023

Hello seminr community,
I'm trying to run a third order construct but I constantly get this error message: "Error in if ((mmMatrix[mmMatrix[, "construct"] == construct, "type"][1] == : missing value where TRUE/FALSE needed". As far as I understand, third-order constructs, and higher, are supported in seminr, but I have not been able to find an example to work with. After validating lower-order constructs, my code for the final structural model is:

MEASUREMENT MODEL

tensions_mm <- constructs(
composite("INT1", multi_items("SUS_CONS_IM_", 1:3)),
composite("INT2", multi_items("SUS_CONS_IP_", 1:3)),
higher_composite("INT", c("INT1","INT2"), method = "two stage"),
composite("EXT1", multi_items("SUS_CONS_E_", 1:2)),
composite("EXT2", multi_items("RES_SCAR_", 1:2)),
higher_composite("EXT", c("EXT1","EXT2"), method = "two stage"),
higher_composite("SUS", c("INT","EXT"), method = "two stage"),
composite("BOUND", multi_items("OB_", 1:11), weights = mode_B),
composite("TENS", single_item("TENSIONS")))

STRUCUTRAL MODEL

tensions_sm <- relationships(
paths(from = c("BOUND"), to = c("TENS", "SUS")),
paths(from = c("TENS"), to = c("SUS")))

ESTIMATION

tensions_pls_model <- estimate_pls(data = survey_data,
measurement_model = tensions_mm,
structural_model = tensions_sm,
inner_weights = path_weighting,
missing = na.omit, #mean_replacement is default
missing_value = "99")

Is there something I am missing?
Thanks for your help.

@soumyaray
Copy link
Contributor

Dear @zizzo I don't think seminr can handle third-order constructs at the moment. It would require two two-stage estimations, and all the complexity inherent in that. I regret we don't have immediate plans to support this in near future. However, I am willing to help you implement it by hand (by code) if you wish to try it.

@zizzo
Copy link
Author

zizzo commented Jan 17, 2023

Dear @soumyaray, thanks for your reply. I'd be keen on trying and, if possible, learning, how to implement third-order constructs in seminr. I'd also like to ask if you have some advice to apply PLS_predict on a model with a third-order construct and a moderator. The message on screen says there is no published solution for that, but possibly under the hoods something can be done. Thanks for your availability and for this great free software package.

@soumyaray
Copy link
Contributor

@zizzo for estimating such a model you can start by identifying the 2nd order sub-constructs (2OC) of your 3rd order construct (3OC). Then create the full PLS model and replace the 3OC by its 2OCs, where each of its 2OCs has the same antecedents and outcomes as the 3OC. Estimate this model and save all the construct scores of the 2OCs into new variables. Then, create the full model again, but this time use the construct scores of the 2OCs as the items of the 3OC (the 3OC is now a first order construct whose items are the 2OC scores). Re-estimate this model and you should get the results as if you had a 3OC model. The problem now will be bootstrapping this whole thing, which you would have to do by hand.

Doing PLSpredict on higher order constructs is not straightforward and a simple solution will not suffice I'm afraid.

@zizzo
Copy link
Author

zizzo commented Jan 19, 2023

Dear @soumyaray, thanks for the explanation. I think it's relatively easy to implement. As you said, bootstrapping is not straightforward though. Do you have any "simple" explanation for the procedure, like the one you gave me for testing the construct? Again, thanks for your time.

@soumyaray
Copy link
Contributor

Hi Zizzo, to implement the bootstrap, you'd have to repeat the above procedure k number of times (where k=1000 or 2000, etc.), each time replacing the original data (of n rows) with a randomly drawn rows (with replacement) from the original data (such that the number of rows is still n). I think you should try to find some tutorials on bootstrapping to get a full description. I'm afraid thats all I can help for now. I will keep this issue open as a reminder for a while to remind that we do not yet implement arbitrarily higher order constructs

@zizzo
Copy link
Author

zizzo commented Feb 1, 2023

Hi @soumyaray. Thank you very much for the explanation and for all your work with SEMinR. I'll have a look at it.
Best

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

2 participants