I suspect the problem is immediately at the start of FOO3().
I suspect the problem is immediately at the start of FOO3(): FOO3 Bias1, pred. Bias2, pred. Bias3, pred.
Bias4, pred. Bias5, pred. Bias6, pred.
Bias7, pred. Bias8, pred. Bias9)) Not sure what you are trying to do when creating outList, but vector() has two arguments and you seem to be assigning to r a vector of numerics that you want R to use as the length argument to vector().
Here you are using the object data. Pls and this doesn't exist yet - and never will in the frame of FOO3() - it is only ever created in cpo(). Your second loop looks totally wrong - you are not assigning the output from cpo() to anything.
I suspect you wanted: outList There are lots of problems with your code. Try to start simple and build up from there.
Thank you for helping me identify the flaws, I'll try again taking your advice into consideration. – DinoSingh Aug 16 at 13:06.
I have managed to achieved what I wanted using this, if there is a better way of doing it (i'm sure there must be) I'm eager to learn. This function preforms the following task 1. Select "n" number of subsets from a dataframe 2.
For each subset created, a plsr model is made 3. Each plsr model is used to predict 9 test sets 4. For each prediction, the prediction bias is calculated far5Cpr2 is a modification of cpo, for which only data is supplied, and the new data to be predicted is used directly in the function as shown below.
Cpr2,8,data=data,validation="LOO") #make plsr model gag11p. PredPredPls,8,newdata=gag13p) gag21p. PredPredPls,8,newdata=gag23p) gag31p.
PredPredPls,8,newdata=gag33p) pred. Bias1Bias2Pred-gag13p742) pred. Bias4Bias5Pred-gag23p742) pred.
Bias7Bias8Pred-gag33p742) rBias3,pred. Bias4,pred. Bias5, pred.
Bias6,pred. Bias7,pred. Bias8,pred.
Bias9),2) outIf there is a more generalized way to do this I'm interested in learning.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.