Message-ID: <CAJcZ3mh_p+-C9QJ7=RBbcKdMvVq-RRZDrMeWcN9-bNKaasemXg@mail.gmail.com>
Date: 2017-06-11T19:16:41Z
From: Sarah Sinasac
Subject: plspm package error in data frame
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