Skip to content

plspm package error in data frame

3 messages · Sarah Sinasac, Bert Gunter, Rui Barradas

#
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:
Then I attempted to set up the pls model using the following code (as
directed by the textbook and the r help function):
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
#
You need to first go through a basic tutorial to learn basic R
constructs and functionality. IMHO, fooling around with special
packages before you learn the basics is a bad strategy. Packages
generally assume you know the basics.

Some tutorial recommendations can be found here:

https://www.rstudio.com/online-learning/

But just googling around the web will turn up lots of alternatives.
Choose what suits you best.


Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sun, Jun 11, 2017 at 12:16 PM, Sarah Sinasac <sinasac.s at gmail.com> wrote:
#
Hello,

Your code throws an error before the line you've mentioned:

 > library(plspm)
 >
 > "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)
Error in rbind(`Behavioural Beliefs`, Attitude, `Normative Beliefs`, 
`Subjective Norm`,  :
   object 'Behavioural Beliefs' not found


Please correct this error and post what 'Behavioural Beliefs' is.

Hope this helps,

Rui Barradas

Em 11-06-2017 20:16, Sarah Sinasac escreveu: