Re: [R] Dataframes in PLS package

2012-03-05 Thread Bjørn-Helge Mevik
westland writes: > R still doesn't seem to recognize the data.frame ... I get a [6] ERROR: > object 'depy.w' not found from the following code: > > dep <- pls[,1:4] > ind <- pls[,5:8] > eqn <- data.frame(depy = dep, indx = ind) > apls <- plsr(depy.w + depy.h + depy.d + depy.s ~ indx.a + indx.i

Re: [R] Dataframes in PLS package

2012-03-05 Thread Bjørn-Helge Mevik
westland writes: > Here is the dput(eqn) and showData for the file 'eqn': [...] >> showData(eqn) > > depy.w depy.h depy.d depy.s indx.a indx.i indx.r indx.x > 63 55 1 0 44 37200 4 0 >145 52 1 1 33 69300 4 1 >104 32 0

Re: [R] Dataframes in PLS package

2012-03-05 Thread Bjørn-Helge Mevik
"R. Michael Weylandt" writes: > Without that though, I'm not sure you need the I(as.matrix.(dep)) and > I(as.matrix(ind)), I would imagine (untested) that eqn <- > data.frame(depy = dep, indx = ind) would work (probably better as I() > changes things just a little). The I() must be there to prev

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
R still doesn't seem to recognize the data.frame ... I get a [6] ERROR: object 'depy.w' not found from the following code: dep <- pls[,1:4] ind <- pls[,5:8] eqn <- data.frame(depy = dep, indx = ind) apls <- plsr(depy.w + depy.h + depy.d + depy.s ~ indx.a + indx.i + indx.r + indx.x, data=eqn)

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
Thanks Michael. I had tried to drop the I(as.matrix(...)) conversions, and fiddled with a number of other permutations of code ... I still can't seem to get it right. The col names appear to be depy and indx ... here is the output (and the rows are just line numbers) > colnames(eqn) [1] "dep

Re: [R] Dataframes in PLS package

2012-03-04 Thread westland
The attach(eqn) seems to change some things in the format, but doesn't solve the problem ... here is my script > dep <- pls[,1:4] > ind <- pls[,5:8] > eqn <- data.frame(depy = dep, indx = ind) > attach(eqn) The following object(s) are masked from 'eqn (position 3)': depy.d, depy.h, depy.

Re: [R] Dataframes in PLS package

2012-03-04 Thread R. Michael Weylandt
It's nice to cc the list for archival reasons -- it also usually gets you a faster response as more folks can see how the thread develops. The problem is that the colnames aren't ctually depy and indx: they are depy.w, depy.h, etc. If you want to model, you need to use those as is: e.g., with your

Re: [R] Dataframes in PLS package

2012-03-04 Thread R. Michael Weylandt
No. Do not do that. While it looks nice at first, it quickly becomes the source of innumerable errors. Michael On Sun, Mar 4, 2012 at 1:56 AM, Kazuo Ishii wrote: > 2012/3/4, westland : >> I am still/again having trouble getting PLSR to recognize the input data >> frames.   Here is what I have do

Re: [R] Dataframes in PLS package

2012-03-03 Thread Kazuo Ishii
2012/3/4, westland : > I am still/again having trouble getting PLSR to recognize the input data > frames. Here is what I have done: > > I read in an 1 x 8 table of data to 'pls' > > assign the first four columns to matrix 'dep' and the second four to matrix > 'ind' with the following comman

Re: [R] Dataframes in PLS package

2012-03-03 Thread R. Michael Weylandt
Can you post dput(head(eqn, 30)) so we can take a look at your data? It's something of a cryptic error and that would go a long way in helping us help you. Without that though, I'm not sure you need the I(as.matrix.(dep)) and I(as.matrix(ind)), I would imagine (untested) that eqn <- data.frame(dep

Re: [R] Dataframes in PLS package

2012-03-03 Thread westland
I am still/again having trouble getting PLSR to recognize the input data frames. Here is what I have done: I read in an 1 x 8 table of data to 'pls' assign the first four columns to matrix 'dep' and the second four to matrix 'ind' with the following commands: dep <- pls[,1:4] ind <- pl

Re: [R] Dataframes in PLS package

2012-02-21 Thread Chris Westland
Dear Bjørn-Helge Mevik: Thank you so much (!!) for your speedy help. This works perfectly, no fuss. My understanding of data.frames is still fuzzy, so I knew it was some flaw in my understanding. I enjoyed your very informative writeups on the package in JSS and R-News; they told me a lot ab

Re: [R] Dataframes in PLS package

2012-02-21 Thread Bjørn-Helge Mevik
westland writes: > Here is what I have done: > > I read in an 1 x 8 table of data, and assign the first four columns to > matrix A and the second four to matrix B > > pls <-read.table("C:/Users/Chris/Desktop/SEM Book/SEM Stat > Example/Simple Header Data for SEM.csv",header=TRUE, sep=

[R] Dataframes in PLS package

2012-02-20 Thread westland
I have been working with the pls procedure and have problems getting the procedure to work with matrix or frame data. I suspect the problem lies in my understanding of frames, but can't find anything in the documentation that will help. Here is what I have done: I read in an 1 x 8 table of