Your newdata newcredit likely does not have the same levels as your credit_ctree on the factor variables. One thing you can do is to check the levels on each oof your variables (not sure what your model looks like). You could check levels like this: levels(newcredit$var) and levels(credit_ctree$var), where var is the variable that you used in the model. The levels must be equal or you will get an error.
But it's difficult to be more specific or to solve the problem without any reproducible data (including your model). Please see: How to make a great r reproducible example.
Your newdata
newcredit
likely does not have the same levels as yourcredit_ctree
on the factor variables. One thing you can do is to check the levels on each oof your variables (not sure what your model looks like). You could check levels like this:levels(newcredit$var)
andlevels(credit_ctree$var)
, where var is the variable that you used in the model. The levels must be equal or you will get an error.But it's difficult to be more specific or to solve the problem without any reproducible data (including your model). Please see: How to make a great r reproducible example.