[R] Dataframes in PLS package
westland
westland at uic.edu
Sun Mar 4 21:11:48 CET 2012
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)
BUT .... I DID try to cbind() these after add-concatenating them (not sure
exactly what I am doing) like so ...
apls <- plsr(cbind(depy.w ,depy.h , depy.d , depy.s) ~ cbind(indx.a , indx.i
, indx.r,indx.x), data=eqn)
And this seems to do the trick ... here is my output.
> summary(apls)
Data: X dimension: 10000 4
Y dimension: 10000 4
Fit method: kernelpls
Number of components considered: 4
TRAINING: % variance explained
1 comps 2 comps 3 comps 4 comps
X 1.000e+02 1.000e+02 1.000e+02 100.00000
depy.w 9.138e-03 9.362e-03 1.087e-02 0.01160
depy.h 4.844e-04 5.010e-03 5.484e-03 0.01304
depy.d 1.900e-02 1.915e-02 1.919e-02 0.01963
depy.s 2.532e-03 1.010e-02 1.104e-02 0.01171
Unfortunately, I still don't understand what I'm doing ... I believe
cbind(...) forced the two data.frames depy and indx. Can anyone perhaps
give me a clearer explanation?
-----
J. Christopher Westland
Professor, Information & Decision Sciences, University of Illinois - Chicago
601 S. Morgan Street (UH2400) Chicago, IL 60607-7124
Telephone +1.312.860.0587
Google Voice +1.209.757.8849
westland at uic.edu
http://uic.edu/~westland
--
View this message in context: http://r.789695.n4.nabble.com/Dataframes-in-PLS-package-tp4405798p4444175.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list