Hi, 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 The problem is that I don't get the message for the pls models. Thank you very much for your help. /Thomas -- *^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^*^* Thomas Möckel, PhD student Department of Earth and Ecosystem Science Lund University Sölvegatan 12 SE-223 62 Lund Sweden Tel:+46 (0)46 - 222 4887 E-mail: Thomas.Mockel@nateko.lu.se [[alternative HTML version deleted]]
Thomas M?ckel <thomas.mockel at 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 suppliedSince 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
Seemingly Similar Threads
- PLS predict
- page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))
- predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())
- equation solver
- [R] fix and edit don't work: unable to open X Input