[R] predict problem

From: Weiwei Shi <helprhelp_at_gmail.com>
Date: Tue 17 May 2005 - 05:27:16 EST

Hi, there:
I have a question on predict() function. I built a set of trees using rpart and when I do prediction, I got the following error:
Error in model.frame.default(Terms, newdata, na.action = act, xlev = attr(object , :

        factor V19 has new level(s) 45
Execution halted

I think the problem is caused by a new level (which is not used in building trees) for V19. I am wondering if there is an argument in predict() which can help suppress this error by just ignoring this special observation in validation sample. If not, I can do some pre-treatment to remove the obs with new level out for the time being.


Weiwei Shi, Ph.D

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue May 17 05:33:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST