Returns a new tree with a maximum depth selected by the user. can be used in conjunction with plot commands to view various pruning levels.
prune(object, ...)
A semtree
or semforest object.
Optional parameters, such as max.depth
the maximum depth
of each tree, or also num.trees
when pruning a forest.
Returns a semtree
object.
The returned tree is only modified by the number of levels for the tree.
This function does not reevaluate the data, but provides alternatives to
reduce tree complexity. If the user would like to alter the tree by
increasing depth, then max.depth option must be adjusted in the
semtree.control
object (provided further splits are able to be
computed).
Brandmaier, A.M., Oertzen, T. v., McArdle, J.J., & Lindenberger, U. (2013). Structural equation model trees. Psychological Methods, 18(1), 71-86.