[R] predict.tree

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Tue May 21 13:04:08 CEST 2002

On Tue, 21 May 2002, poul svante wrote:

> I have a problem with interpretating the result of predict.tree,
> when I include the option split=T.
> E.g. running the example of the help file and concluding with
> >   predict(shuttle.tr, shuttle1,split=T)
> produces the output
>                      auto            noauto
> [1,] 0.015625002 0.007812502
> [2,] 0.007812502 0.000000000
> [3,] 0.000000000 0.000000000
> which is hard to interpret as a posterior probability.
> And since no values are missing for the predictors, I would
> expect to get the same result as with split=F?
> Comments?

It works correctly in S. Inside predict.tree you will find a function
pred2.tree, and inside that is a .C call.  Change double() to single().

We do recommend that you use rpart for tree construction, and by no means
all the options of package tree have been tested under R.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list