Closed timolingh closed 8 years ago
Hi! Well, as you said: the problem is simply that factor level "e" does not exist in your second data-set (somehow similar to #47).
The behavior of mboost
in this case is not extremely user-friendly and the error message unfortunately does not help a lot. Anyhow, if you really just need those predictions, a solution (as you might know anyway) is of course:
# set equal levels
levels(bar$q) <- levels(foo$q)
# omitting droplevels
lm2.pred <- predict(lm2, newdata = bar)
Thank you. Somehow after all this time, I did not know that.
I'm having a problem trying to use a glmboost object to predict values with a new dataset. The new dataset has 1 less level for one of it's categorical variables. I think this should still work and if you use predict on a vanilla 'lm' object it does work. Can you advise?