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

Issue with pls.groups command #21

Open
jameshannay opened this issue Dec 23, 2022 · 0 comments
Open

Issue with pls.groups command #21

jameshannay opened this issue Dec 23, 2022 · 0 comments

Comments

@jameshannay
Copy link

I encounter this error while running the pls.groups command:

Error in if (w_dif < specs$tol || iter == specs$maxiter) break : 
missing value where TRUE/FALSE needed

I have removed all NA values and have deleted any observations that hold the same values across all variables. My data is all of the right type (for groups, being a two-level factor). I have addressed these problems due to reading about a similar case here:

https://stackoverflow.com/questions/31685143/hurdle-in-pls-path-modeling

Below is my code and a link to my dataset

farmwood = read.csv("farmwood_groups(distance).csv", header = TRUE) %>%

slice(-c(119:123))

Control = c(0,0,0,0,0,0)
Normative = c(0,0,0,0,0,0)
B_beliefs = c(0,0,0,0,0,0)
P_control = c(1,0,0,0,0,0)
S_norm = c(0,1,0,0,0,0)
Behavior = c(0,0,1,1,1,0)


farmwood_path = rbind(Control, Normative, B_beliefs, P_control, S_norm, Behavior)

colnames(farmwood_path) = rownames(farmwood_path)

farmwood_blocks = list(14:18,20:23,8:13,24:27,19,4:7)
farmwood_modes = rep("A", 6)

farmwood_pls = plspm(farmwood, farmwood_path, farmwood_blocks, modes = farmwood_modes)

names(farmwood)[names(farmwood) == "QB3"] <- "Distance"

farmwood$Distance <- as.factor(farmwood$Distance)

distance_boot = plspm.groups(farmwood_pls, farmwood$Distance, method = "bootstrap")

distance_perm = plspm.groups(farmwood_pls, farmwood$Distance, method = "permutation")

Data: https://www.dropbox.com/s/8vewuupywpi1jkt/farmwood_groups%28distance%29.csv?dl=0

Any help would be appreciated. Thank you in advance.

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