[R] rpart

From: <henrigel_at_gmx.de>
Date: Mon 25 Sep 2006 - 12:55:04 GMT


Dear r-help-list:

If I use the rpart method like

cfit<-rpart(y~.,data=data,...),

what kind of tree is stored in cfit?
Is it right that this tree is not pruned at all, that it is the full tree?

If so, it's up to me to choose a subtree by using the printcp method. In the technical report from Atkinson and Therneau "An Introduction to recursive partitioning using the rpart routines" from 2000, one can see the following table on page 15:

      CP  nsplit  relerror  xerror   xstd
1   0.105   0     1.00000   1.0000   0.108
2   0.056   3     0.68519   1.1852   0.111
3   0.028   4     0.62963   1.0556   0.109
4   0.574   6     0.57407   1.0556   0.109
5   0.100   7     0.55556   1.0556   0.109

Some lines below it says "We see that the best tree has 5 terminal nodes (4 splits). Why that if the xerror is the lowest for the tree only consisting of the root?

Thank you very much for your help

Henri

--

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue Sep 26 17:45:22 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 26 Sep 2006 - 09:30:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.