-
Notifications
You must be signed in to change notification settings - Fork 19
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
Error when running moderator analysis #325
Comments
Dear @tomryjo thanks for sharing your code. I simulated data by munging the mobi dataset and renaming the columns. Ignore this part. But the subsequent code works. Essentially you forgot to use the "*" in the interaction term names. I also abbreviated the names for sanity.
|
Please close the issue if resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got this error message when running moderator analysis:
Error in first_stage$construct_scores[, moderator] :
subscript out of bounds
This is the code I use:
Define measurements with familiar terms: reflective, composite, multi-item constructs, etc.
mobi_mm <- constructs(
composite("Overconfidence", multi_items("v1.", 1:7)),
composite("Illusion of control bias", multi_items("v2.", 1:4)),
composite("Self-attribution bias", multi_items("v3.", 1:9)),
composite("Herding behavior", multi_items("v4.", 1:5)),
composite("Information availability", multi_items("v5.", 1:5)),
composite("Financial literacy", multi_items("v6.", 1:6)),
interaction_term(iv= "Illusion of control bias", moderator = "Information availability",method = two_stage),
interaction_term(iv= "Self-attribution bias", moderator = "Information availability",method = two_stage),
interaction_term(iv= "Overconfidence", moderator = "Financial literacy",method = two_stage)
)
Create structural model
overriding_effects_sm <- relationships(
paths(from = c("Overconfidence","OverconfidenceFinancial literacy"), to = "Herding behavior"),
paths(from = c("Illusion of control bias","Self-attribution bias","Information availability","Illusion of control biasInformation availability","Self-attribution bias*Information availability"), to = "Herding behavior")
)
Plot the model
plot(overriding_effects_sm)
Models with reflective constructs are automatically estimated using PLSc
pls_model <- estimate_pls(data = my_data, mobi_mm, overriding_effects_sm
, missing = mean_replacement
, missing_value = "-99"
)
model_summary <- summary(pls_model)
model_summary
Please help as the deadline is coming! Many thanks.
The text was updated successfully, but these errors were encountered: