Re: [R] Problems with data structure when using plsr() from package pls

2016-01-18 Thread CG Pettersson
quot;n96 3" "n96 4" ... Which is exactly the same structure as the supplied datasets in package pls, and works well with plsr() Thanks a lot for the help! /CG -Ursprungligt meddelande- Från: CG Pettersson Skickat: den 17 januari 2016 13:30 Till: 'S Ellison'; Sar

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-18 Thread Bjørn-Helge Mevik
S Ellison writes: > Reading ?plsr examples and inspecting the data they use, you need to arrange > frame1 so that it has the data from n96 included as columns with names of the > from "n96.xxx" whre xxx can be numbers, names etc. No, you do not. :) plsr() is happy with a data frame where n96 is

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-17 Thread CG Pettersson
h Goslee; CG Pettersson Kopia: r-help@r-project.org Ämne: RE: [R] Problems with data structure when using plsr() from package pls > > I am trying to make pls-regression using plsr() from package pls, > > with Mevik & Wehrens (2007) as tutorial and the datasets from the packag

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-15 Thread S Ellison
> > I am trying to make pls-regression using plsr() from package pls, with > > Mevik & Wehrens (2007) as tutorial and the datasets from the package. > > Everything works real nice as long as I use the supplied datasets, but > > I don´t understand how to prepare my own data. > > This is what I have

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-15 Thread Sarah Goslee
Backing up a step: On Wednesday, January 13, 2016, CG Pettersson wrote: > R version 3.2.3, W7 64bit. > > Dear all! > > I am trying to make pls-regression using plsr() from package pls, with > Mevik & Wehrens (2007) as tutorial and the datasets from the package. > Everything works real nice as lo

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-15 Thread Bjørn-Helge Mevik
Jeff Newmiller writes: > Using I() in the data.frame seems ill-advised to me. You complain about 96 > variables but from reading your explanation that seems to be what your data > are. In PSLR, it is common to regress a variable against matrices with very many coloumns, often several thousands.

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-15 Thread Bjørn-Helge Mevik
CG Pettersson writes: >> frame1 <- data.frame(gushVM, I(n96)) [...] >> pls1 <- plsr(gushVM ~ n96, data = frame1) > Error in model.frame.default(formula = gushVM ~ n96, data = frame1) : > invalid type (list) for variable 'n96' As far as I can remember, you get this error if the n96 object was

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-14 Thread David Winsemius
ou put a copy of it into the `frame1`-object? Maybe it wasn't a simple matrix. You need at the very least to post the output of str(n96). Also never use attach(). -- David. > > So I am still stuck > /CG > > Från: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] >

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-14 Thread CG Pettersson
Whatever I do ends with " invalid type (list) for variable 'n96'" So I am still stuck /CG Från: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Skickat: den 14 januari 2016 05:16 Till: CG Pettersson; r-help@r-project.org Ämne: Re: [R] Problems with data structure when using pls

Re: [R] Problems with data structure when using plsr() from package pls

2016-01-13 Thread Jeff Newmiller
Using I() in the data.frame seems ill-advised to me. You complain about 96 variables but from reading your explanation that seems to be what your data are. I have no idea whether it makes sense to NOT have 96 variables if that is what your data are. Note that a reproducible example supplied by y

[R] Problems with data structure when using plsr() from package pls

2016-01-13 Thread CG Pettersson
R version 3.2.3, W7 64bit. Dear all! I am trying to make pls-regression using plsr() from package pls, with Mevik & Wehrens (2007) as tutorial and the datasets from the package. Everything works real nice as long as I use the supplied datasets, but I don�t understand how to prepare my own data.