[R] party package conditional variable importance

Meghann Mears meghann.mears at googlemail.com
Fri Feb 6 11:32:57 CET 2009


Hello,

I'm trying to use the party package function varimp() to get
conditional variable importance measures, as I'm aware that some of my
variables are correlated.  However I keep getting error messages (such
as the example below).  I get similar errors with three separate
datasets that I'm using.  At a guess it might be something to do with
the very large number of variables (e.g. 23 variables, 250 or so data
points) but I was wondering if anyone had any other ideas.  It works
fine for regular variable importance calculation.

Code:

biomass.cf<-cforest(Total.biomass ~ .,
data=biomass,	control=cforest_unbiased(ntree=2500, mtry=8))
biomass.cf.vi<-varimp(biomass.cf, conditional=TRUE)

Error:

Error in if (node[[5]][[1]] == variableID) cp <- node[[5]][[3]] :
  argument is of length zero
In addition: Warning messages:
1: In matrix(as.logical(cl), nrow = nlevels(x)) :
  data length [2] is not a sub-multiple or multiple of the number of rows [17]
2: In matrix(as.logical(cl), nrow = nlevels(x)) :
  data length [2] is not a sub-multiple or multiple of the number of rows [17]
3: In matrix(as.logical(cl), nrow = nlevels(x)) :
  data length [2] is not a sub-multiple or multiple of the number of rows [17]
4: In matrix(as.logical(cl), nrow = nlevels(x)) :
  data length [2] is not a sub-multiple or multiple of the number of rows [17]

Many thanks,

Meghann Mears, PhD student
University of Sheffield
Department of Animal & Plant Sciences




More information about the R-help mailing list