[R] Problem with party and ordered factors

dittmann at in.tum.de dittmann at in.tum.de
Fri Feb 2 16:41:14 CET 2007


Hi All,

i've got a problem using the ctree function of the party package. I've
searched around a lot but couldn't manage it.
I've got an ordered factor as response. As far as i know i have to use
scores to be able to use this ordered factor. But if i do so i get a tree
which predicts all observations as the first level of my ordered factor.

In order to test if i did anything wrong i tried the example of Torsten
Hothorn, Kurt Hornik and Achim Zeileis described in the documentation
party: A Laboratory for Recursive Part(y)titioning

There i got the same problem. I execute the following code:
> data("mammoexp", package = "party")
> mtree <- ctree(ME ~ ., data = mammoexp, scores = list(ME = 1:3, SYMPT =
1:4, DECT = 1:3))
> plot(mtree)

Beside getting one waring everthing's ok. But when i excute
summary(predict(mtree)) the result is:
 Never Within a Year   Over a Year
  412             0             0

So now i'm stuck. Am i doing anything wrong? I'm using R 2.4.1 and all
packages are uptodate.

Thanks in advance for your help.

Sincerely yours
Christoph



More information about the R-help mailing list