While I’m not familiar with the party package (sadly), I have a guess. The model object created with formula has an internal representation of the data it was passed, and this includes a vector of data classes. In the model with formula, it expects clkmeans and resty to be factors, and in the model with formula2 it expects them to be whatever their original classes were. So when subsetting the data, you need to convert these variables like this:
predict_data = olddata[1:100,]
predict_data$clkmeans = as.factor(predict_data$clkmeans)
predict_data$resty = as.factor(predict_data$resty)
You might also run into an issue with column names, in which case you’ll have to convert the names of clkmeans and resty to "factor(clkmeans)" and "factor(resty)".
--
Check out our R resources at http://www.noamross.net/davis-r-users-group.html
---
You received this message because you are subscribed to the Google Groups "Davis R Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to davis-rug+...@googlegroups.com.
Visit this group at http://groups.google.com/group/davis-rug.
For more options, visit https://groups.google.com/d/optout.