| prune_unconfirmed | R Documentation |
Takes a discovery tree and its confirmation, and returns the tree with every split that failed to confirm collapsed into a terminal node.
prune_unconfirmed(
tree,
confirmation,
alpha = 0.05,
which = c("adjusted", "raw"),
outcome = "any"
)
tree |
The |
confirmation |
A |
alpha |
Level at which a split counts as confirmed. Default 0.05. |
which |
Which p-value to use: |
outcome |
For a multivariate outcome, the name of the outcome whose
tests govern pruning, or |
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.
A ctreeMI object with unconfirmed splits collapsed. Its
ctreeMI_info attribute gains confirmed, a data frame recording which
splits were retained and why.
confirm_ctreeMI(), discover_confirm()
## Not run:
res <- discover_confirm(y ~ ., data = d, m = 30, seed = 1)
pruned <- prune_unconfirmed(res$tree, res$confirmation)
plot(pruned)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.