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 ofnodeInds
excluding leaves;length(pVals)
: number of internal nodesnames(pVals)
: the name of splitting variable at each nodeeach item of
pVals
is a numeric vector of p-vals for all variables whosep-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 thespVar
sCut
: the splitting pointgtOnRight
: 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 increasingy
,gtOnRight==T
means thespVar
has positive association withy
.
spVars.str
, a string combining all rows ofspVars.df
. rows are separated by ';' and cells are by ','
if cRe has only one root node, i.e. no splitting, NULL is returned