Re: [R] predict() an rpart() model: how to ignore missing levels in a factor

2010-11-19 Thread jamessc
many thanks - that's perfect, excluding records on a rep-by-rep basis is what I was just hoping for but I probably didn't explain myself that well! James -- View this message in context:

[R] predict() an rpart() model: how to ignore missing levels in a factor

2010-11-18 Thread jamessc
I am using an algorigm to split my data set into two random sections repeatedly and constuct a model using rpart() on one, test on the other and average out the results. One of my variables is a factor(crop) where each crop type has a code. Some crop types occur infrequently or singly. when the

Re: [R] predict() an rpart() model: how to ignore missing levels in a factor

2010-11-18 Thread Jonathan P Daily
I don't think that, considering the mechanism behind recursive partitioning, that there is any way for you to ignore the crop factor if it is not in the original test set. What decision should be made if, for instance, the next split in a decision tree were on crops and output was 5 for