Amit Patel <amitrh...@yahoo.co.uk> writes:

>>str(FullDataListTrans)
>  num [1:40, 1:94727] 42 40.9 65 56 61.7 ...
>  - attr(*, "dimnames")=List of 2
>   ..$ : chr [1:40] "X" "X.1" "X.12" "X.13" ...
>   ..$ : NULL
>
> I have also created a vector "GroupingList" which gives the groupnames for 
> each 
> respective sample(row).
>
>> GroupingList
>  [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 
> 4 4
> [39] 4 4
>> str(GroupingList)
>  int [1:40] 1 1 1 1 1 1 1 1 1 1 ...
>
> I am now stuck while conducting the plsr. I have tried various methods of 
> creating structured lists etc  and have got nowhere. I have also tried many 
> incarnations of 
>
>
> BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = FeaturePresenceExpected[1], 
> data 
> = FullDataListTrans, validation = "LOO")
>
> Where am I going wrong.

You are not telling us what happens (or how you tried to make
"structured lists"), but from your description of the
data, FullDataListTrans is a matrix with only the the predictor
variables, and GroupingList is a vector with the response.  The data
argument of plsr() (as of most modelling functions in R) expects a
data.frame with both response and predictor variables.

Try this:

mydata <- data.frame(GroupingList = GroupingList, PCIList = 
I(FullDataListTrans))

(The I() is to prevent R from making the coloumns in FullDataListTrans
separate variables in the data frame.)

BHPLS1 <- plsr(GroupingList ~ PCIList, ncomp = FeaturePresenceExpected[1], data 
= FullDataListTrans, validation = "LOO")

-- 
Regards,
Bjørn-Helge Mevik

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to