prune_unconfirmed: Collapse Splits That Did Not Confirm

View source: R/confirm.R

prune_unconfirmedR Documentation

Collapse Splits That Did Not Confirm

Description

Takes a discovery tree and its confirmation, and returns the tree with every split that failed to confirm collapsed into a terminal node.

Usage

prune_unconfirmed(
  tree,
  confirmation,
  alpha = 0.05,
  which = c("adjusted", "raw"),
  outcome = "any"
)

Arguments

tree

The ctreeMI object that was confirmed.

confirmation

A ctreeMI_confirm object from confirm_ctreeMI().

alpha

Level at which a split counts as confirmed. Default 0.05.

which

Which p-value to use: "adjusted" (default) or "raw".

outcome

For a multivariate outcome, the name of the outcome whose tests govern pruning, or "any" (default) to retain a split confirmed for any outcome, or "all" to require every outcome.

Details

Pruning is bottom-up and a split is collapsed only once all of its own internal descendants have been collapsed, matching prune_stackM(). A split whose p-value could not be computed, because a child node fell below min_node in some imputation, is treated as unconfirmed; the tree offers no evidence for it on the confirmation data.

The result is the partition the confirmation data supports. Its terminal nodes can be reported without the caveat that attaches to the discovery tree, since the splits defining them were tested on data the tree had not seen.

Value

A ctreeMI object with unconfirmed splits collapsed. Its ctreeMI_info attribute gains confirmed, a data frame recording which splits were retained and why.

See Also

confirm_ctreeMI(), discover_confirm()

Examples

## Not run: 
res <- discover_confirm(y ~ ., data = d, m = 30, seed = 1)
pruned <- prune_unconfirmed(res$tree, res$confirmation)
plot(pruned)

## End(Not run)

ctreeMI documentation built on Oct. 12, 2026, 5:08 p.m.