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

Error in predict_pls function #347

Open
dalitmilshtein opened this issue Feb 7, 2024 · 2 comments
Open

Error in predict_pls function #347

dalitmilshtein opened this issue Feb 7, 2024 · 2 comments
Assignees
Labels

Comments

@dalitmilshtein
Copy link

When I try to run this function:
PPower_Emotional <- predict_pls( model = ModelNeg, technique = predict_DA, noFolds = 10, reps = 10)
I get this error massage:
Error in pred_matrices$out_of_sample_item[as.character(c(1:nrow(model$data))), :
subscript out of bounds

Impotently, apart from this issue, I manage to run all the other functions with this mediation model

This is my model:

`#measurment model
mediation_M <- constructs(
composite("Direct_relevancy", multi_items("Rel", 1:3),weights = mode_B ),
composite("Imaginability", multi_items("Img", 1:2),weights = mode_A),
composite("Emotional_intensity", single_item("Intensity")),
composite("Thought_suppression", single_item("Regulation")),
composite("Indirect_relevancy", single_item("Feasibility" ))
)

#structural model
mediation_S <- relationships(
paths(from = c("Direct_relevancy"), to = c("Thought_suppression")),
paths(from = c("Direct_relevancy"), to = c("Emotional_intensity")),
paths(from = c("Imaginability"), to = c("Thought_suppression")),
paths(from = c("Imaginability"), to = c("Emotional_intensity")),
paths(from = c("Indirect_relevancy"), to= c("Imaginability")),
paths(from = c("Indirect_relevancy"), to = c("Direct_relevancy")),
paths(from = c("Emotional_intensity"), to = c("Thought_suppression"))) `

This is the structure of my DATA fRAME:
image

@dalitmilshtein
Copy link
Author

so it is silly bug, however I find a solution by forcing the rownames of my input data to be a complete sequential series:
row.names(DF_Emotional) <- 1:nrow(DF_Emotional)

@soumyaray
Copy link
Contributor

Interesting error! I'm going to reopen this because we should perhaps sanitize rownames in data.frames. Something to consider for next update. Thanks for submitting @dalitmilshtein

@soumyaray soumyaray reopened this Feb 8, 2024
@soumyaray soumyaray added the bug label Feb 8, 2024
@soumyaray soumyaray self-assigned this Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants