0

I am looking for some help in resolving an error using the partial least squares path modeling package ('plspm').

I can get results running a basic PLS-PM analysis but run into issues when using the grouping function, receiving the error message:

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

I have no missing values and all variables have the proper classification. Elsewhere I read that there is a problem with processing observations with the exact same values across all variables, I have deleted those and still face this issue. I seem to be facing the issue only when I run the groups using the "bootstrap" method as well.

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)
ames(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")

The data is contained here:

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

Any help would be appreciated. Thank you in advance

  • You can try estimating the loadings and weights such as the kernel or nnls methods – User 123732 Dec 23 '22 at 17:25
  • That line of code appears to be [`get_weights.R#L53`](https://github.com/cran/plspm/blob/242e1d54da4f5d5f20e748248da9f4c776b3ac7d/R/get_weights.R#L53). That package was removed from CRAN in 2020 ("long orphaned"), confirmed by its [original repo](https://github.com/gastonstat/plspm) where the only commits since 2015 were some in Mar 2022 updating the "Donations" section of the README. Since the author still appears to be around, I suggest writing a [bug report](https://github.com/gastonstat/plspm/issues/new), adding reproducibility (sample data). – r2evans Dec 23 '22 at 17:26
  • Bottom line, though, is that the package error is a dupe of https://stackoverflow.com/q/7355187/3358272; even if it's not your code, that's the underlying problem. As for your data, you might want to check for presence of `NA`, invariance of data, etc, to see that you're providing everything correctly as the package expects. (Disclaimer, I don't know the package and have only briefly looked at the code enough to come to this conclusion.) Good luck! – r2evans Dec 23 '22 at 17:28

0 Answers0