ligt meddelande-
Från: S Ellison [mailto:s.elli...@lgcgroup.com]
Skickat: den 15 januari 2016 14:39
Till: Sarah 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(
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
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
> > 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
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
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.
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
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]
>
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
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
10 matches
Mail list logo