[R] plspm package error in data frame

Bert Gunter bgunter.4567 at gmail.com
Sun Jun 11 21:54:40 CEST 2017


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,
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list