[R] plspm package error in data frame
Sarah Sinasac
sinasac.s at gmail.com
Sun Jun 11 21:16:41 CEST 2017
Hello,
I am new to R and hope I will not seem ignorant in this post. I am
currently using the plspm package by Gaston Sanchez accompanied by his
text book.
I have attempted to create a square matrix, which has seemed
successful. I used the following code:
> "Attitude" = c(1, 0, 0, 0, 0, 0, 0, 0)
> "Normative Beliefs" = c(1, 0, 0, 0, 0, 0, 0, 0)
> "Subjective Norm" = c(0, 0, 1, 0, 0, 0, 0, 0)
> "Control Beliefs" = c(1, 0, 1, 0, 0, 0, 0, 0)
> "Perceived Behavioural Control" = c(0, 0, 0, 0, 1, 0, 0, 0)
> "Intention" = c(0, 1, 0, 1, 0, 1, 0, 0)
> "Behaviour" = c(0, 0, 0, 0, 0, 0, 1, 0)
> TPB_path = rbind(`Behavioural Beliefs`, Attitude, `Normative Beliefs`, `Subjective Norm`, `Control Beliefs`, `Perceived Behavioural Control`, Intention, Behaviour)
> colnames(TPB_path) = rownames(TPB_path)
> innerplot(TPB_path, box.size = 0.1)
Then I attempted to set up the pls model using the following code (as
directed by the textbook and the r help function):
> #outermodel
> TPB_blocks = list(1:7, 8:14, 15:21, 22:28, 29:34, 35:39, 40:44, 45:48)
> TPB_modes = rep("A", 8)
> TPB_pls1 = plspm(TPBDATA, TPB_path, TPB_blocks, modes = TPB_modes)
However, I received the following error (I tried multiple times, and
cannot determine what the error is):
Error in `[.data.frame`(crossloadings, , c("name", "block", colnames(xloads))) :
undefined columns selected
I would really appreciate if anyone could provide advice on how to
correct this error. I am using the plspm package in order to analyze
my data for my masters thesis at the University of Waterloo.
Thank you!
Sarah
More information about the R-help
mailing list