[R] How to get predicted probabilities out of a class.tree

jones christian christian.jones at lycos.com
Sat Apr 29 19:33:04 CEST 2006

I would like to use a classification tree as a species modelling method. The dependent variable is binary (0,1),the independent variables are numeric. So I have to surround the dependent variable with factor(). That tells tree() that I want a logistic, or classification, tree rather than a regression tree. Here the code (tree(formula = factor(y) ~ x1 + x2 + x3)
For interpretation reasons I prefer to have the predicted probabilities  between 0 and 1 at every leaf point but as a result I only get a discret value of 0 or 1. Leaving out "factor" plots the desired predicted probabilities but then the selected variables differ (decision rules of classification vs regression tree)and above all I guess this would violate the convention?!
So does anyone know how to go about this?
many thanks in advance


Search for businesses by name, location, or phone number.  -Lycos Yellow Pages


More information about the R-help mailing list