[R] partial r2 using PLS

Dr Carbon drcarbon at gmail.com
Sat Mar 5 15:08:41 CET 2005


I'm trying to get the coefficient of partial determination for each of
three independent variables. I've tried mvr in package pls.pcr. I'm a
little confused by the output. I'm curious how I can order the LV's
according to their names rather than their relative contribution to
the regression.

For instance, using the crabs data from MASS I made a regression of FL~RW+noise

set.seed(124)
library(pls.pcr)
library(MASS)
attach(crabs)
crabs.simpls <- mvr(data.frame(x1 = RW,x2 = runif(200)), FL,
validation="CV", method="SIMPLS")
summary(crabs.simpls)
crabs.simpls <- mvr(data.frame(x1 = runif(200), x2 = RW), FL,
validation="CV", method="SIMPLS")
summary(crabs.simpls)
# compare to summary(lm(FL~RW+runif(200)))
detach(crabs)

The two summaries are almost identical, as are the inputs. But the order of
the LVs are different. How can I know that it is x1 is the useful
predictor in the first example and that x2 is the useful predictor in
the second example. I hope to run a three variable regression in a MC
framework and output the partial rsq for x1, x2, and x3 in every run.

Can I do this? I fear I've made some fundamental misunderstanding about mvr()

Thanks, DC

> version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    0.1            
year     2004           
month    11             
day      15             
language R




More information about the R-help mailing list