[R] predict.mvr error message

Liaw, Andy andy_liaw at merck.com
Fri Aug 27 04:39:43 CEST 2004


What version of R, what version of pls.pcr, and on what OS?  Have you
checked whether your versions of software are up to date?  I get:

> n <- 1350
> p <- 180
> y <- rnorm(n)
> x <- matrix(sample(0:1, n*p, replace=TRUE), n, p)
> fit <- mvr(x, y, method="SIMPLS", validat="none", ncomp=2)
> xt <- matrix(sample(0:1, 312*p, replace=TRUE), 312, p)
> yt <- predict(fit, xt)


Andy

> From: Stewart T Chang
> 
> Greetings,
> 
> I've encountered an error message while using the pls.pcr package
> that's left me scratching my head for a couple of hours, and 
> I thought I
> might post it here in the hopes that someone else uses this package.
> Using a data set of 1350 observations (each observation comprises 180
> predictor variables and 1 output variable), I trained a model using
> pls.pcr.  (Other details: ncomp=2, 
> method="SIMPLS",validation="none".  I
> might also add that each predictor variable has a value of 
> either 0 or 1,
> though the output variable is a real number.)
> '
> When I tried to use this model to make predictions (on 312 sets of 180
> predictor variables), I received the following error:
> 
> Error in X %*% object$training$B[, , index, drop = TRUE] :
>         requires numeric matrix/vector arguments
> 
> Normally I'd ask a friend of mine in Biostatistics here to 
> help me out,
> but he's currently away!  Have any of you used pls.pcr and gotten this
> kind of message?  Thanks!
> 
> Stewart
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list