Skip to contents

Introduction

The main function is citree::runCtree(), which is a wrapper of partykit::ctree() with addition functions:

  • partykit::ctree() only produces the best separation at each node, i.e. one tree. By setting recursive = T in citree::runCtree(), all trees meeting p-val cutoff are produced and saved. Each round of recursion is done by removing the 1st splitting variable from the input data.frame and running runCtree(); the recursion stops if no splitting variable is found.
  • The info and stats of each node of each tree are collected and summarized in an excel file, which also contains ULRs to each tree.
  • Before running partykit::ctree(), low-informative columns and rows are removed to reduce computation and adjustment on association p-vals

Note:

  • ctree uses coin::independence_test() to test the association of two variables of any data type. See here for theory behind the test, and here for an explanation of the algorithm.
  • see here for discussions on the pros and cons of ctree in comparison to other trees, e.g. rpart.

Example

library(citree)
data('mtcars')
re=runCtree(mtcars,'mtcars',oDir='tmp')

check the tmp directory for output.