Skip to contents

see @return for details. Note that package partykit is loaded, but not attached, in this function.

Usage

ctree2splitInfo(cRe, pCut, nodeInds = partykit::nodeids(cRe, terminal = F))

Arguments

cRe

object returned from partykit::ctree()

pCut

numeric; p-val cutoff to be significant

nodeInds

int vectors, e.g. 1:5 for a tree of five nodes, including leaves

Value

return a list of following items:

  • pVals is a list of significant variables at each node of nodeInds excluding leaves;

    • length(pVals): number of internal nodes

    • names(pVals): the name of splitting variable at each node

    • each item of pVals is a numeric vector of p-vals for all variables whose p-val <= pCut, ordered by increasing p-vals

  • spVars.df a data.frame of following four columns, one node per row,

    • variable: the name of splitting variable (spVar)

    • pVal: the p-val of the spVar

    • sCut: the splitting point

    • gtOnRight: T/F; are observations of greater (gt: greater than) values on the right branch of the node? The separation of numeric spVar is always <= and >; if the leaves are listed in increasing y, gtOnRight==T means the spVar has positive association with y.

  • spVars.str, a string combining all rows of spVars.df. rows are separated by ';' and cells are by ','

if cRe has only one root node, i.e. no splitting, NULL is returned

Examples

# none