Skip to content

Proportion of 1's in terminal nodes of CTREE()

1 message · Preetam Pal

#
Hi R-users,

I have created a Conditional Tree using the ctree function ( in package
partykit). The data had a factor - the y variable - and a host  of
categorical x-variables.
Now, I want to find the proportion of cases where y = 1 in each of the
terminal nodes.

Is it possible to do so programmatically?


*Tree <- ctree( y~., data = mydata, ctree_control = c(maxdepth = 4))*

Regards,
Preetam