[R] plspm package error in data frame

Rui Barradas ruipbarradas at sapo.pt
Mon Jun 12 11:29:37 CEST 2017


Hello,

Please allways cc the list, don't answer just to me.

Now I'm getting a different error. I had noticed that you have no 
reference to 'TPBDATA' before the call to plspm but I forgot to mention 
it in my first e-mail.


TPB_pls1 = plspm(TPBDATA, TPB_path, TPB_blocks, modes = TPB_modes)
Error in is_tabular(x) : object 'TPBDATA' not found

So we need to know what 'TPBDATA' is.

Rui Barradas

Em 12-06-2017 00:19, Sarah Sinasac escreveu:
> Hello Rui,
> I must have missed that line when I copied and pasted my code.
> Behavioural Beliefs is:
> "Behavioural Beliefs" = c(0, 0, 0, 0, 0, 0, 0, 0)
>
> Thank you,
> Sarah
>
> On Sun, Jun 11, 2017 at 4:36 PM, Rui Barradas <ruipbarradas at sapo.pt> 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:
>>>
>>> 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