Re: [R] ctree (party) plot meaning question

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Mon, 30 Jun 2008 22:06:23 +0100

On Mon, 2008-06-30 at 10:41 -0700, Birgitle wrote:
> I tried to use ctree but am not sure about the meaning of the plot.
>
> My.data.ct<-ctree(Resp~., data=My.data)
> plot(My.data.ct)
>
> My data.frame contains 88 explanatory variables (continous,ordered/unordered
> multistate,count data) and one response with two groups.
>
> In the plot are only two variables shown (2 internal nodes) and 3 final
> nodes. Does it mean that only these two variables show a significant
> asssociation with the response?
>
> :confused:
>
> Many thanx in advance

Yes, very simply. Nodes are only split if a split has a p-value of less than 1-mincriterion, where mincriterion is 0.95 by default, in a test of independence between the response variable and the predictor.

Using an internal data set:

mod <- ctree(Species ~ . , data = iris)
plot(mod)

The plot (on my machine) shows 3 internal nodes resulting in 4 leaves. Petal length and petal width are the two selected variables. The Sepal length and width variables are not selected.

Now what happens if we reduce mincriterion? (This is a silly example - you wouldn't want to select a split with a p-value that high):

mod1 <- ctree(Species ~ . , data = iris,

              control = ctree_control(mincriterion = 0.8)) plot(mod1)

Now we see that a further split on Petal width has been made, but notice the p-value for this split.

So nodes are only split if the null hypothesis of independence between a the response and the predictors cannot be rejected at the given level of significance (1 - mincriterion).

This is a different approach to rpart/mvpart, where splitting is based on a few simple stopping rules and then cross-validation is used to prune the tree back.

You'd be best to read the cited references in ?ctree for more background on these conditional inference trees.

HTH G

>
> B.
>
>
>
>
>
> -----
> The art of living is more like wrestling than dancing.
> (Marcus Aurelius)



R-help_at_r-project.org 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 Mon 30 Jun 2008 - 21:11:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 30 Jun 2008 - 21:31:38 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.

list of date sections of archive