library(rpart)
library(party)
Ls <- data.frame(y = gl(3, 50, labels = c("A", "B", "C")), x1 = rnorm(150) + rep(c(1, 0, 0), c(50, 50, 50)), x2 = runif(150))
Ls.tr<-ctree(y ~ x1 + x2, data = Ls,control = ctree_control(teststat = "quad",testtype = "Bonferroni",minsplit=4,maxsurrogate=1))
plot(Ls.tr)
Predict(Ls.tr, newdata = Ls)
treeresponse(ct, newdata = Ls[c(1, 51, 101), ])