Thomas Möckel <thomas.moc...@nateko.lu.se> writes:

> I work with hyperspectral remote sensing data and I try to built a pls 
> model with this data. I already built the model but if I try to 
> calculate the RMSEP and R2 with a test data set I get the following 
> error message:
>
> Error: variable 'subX' was fitted with type "nmatrix.501" but type 
> "nmatrix.73" was supplied

Since you don't show what commands you used, this is guesswork, but my
guess is that you used

yourmodel <- plsr(yourresponse ~ subX, data = yourdata)
R2(yourmodel, newdata = yournewdata)

and that yourdata$subX contains 501 coloumns, but yournewdata$subX only
contains 73 coloumns.  You must supply a newdata with the same number of
coloumns as in the modelling data.

-- 
Regards,
Bjørn-Helge Mevik

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to