R: make pls calibration models from n number of subset and use them to predict different test sets
问题 I am trying to apply a function I wrote that uses the 'pls' package to make a model and then use it to predict several test set(in this case 9), returning the R2,RMSEP and prediction bias of each test set for n number of subset selected from the data frame. the function is cpo<-function(data,newdata1,newdata2,newdata3,newdata4,newdata5,newdata6,newdata7,newdata8,newdata9){ data.pls<-plsr(protein~.,8,data=data,validation="LOO")#making a pls model newdata1.pred<-predict(data.pls,8,newdata