proximity {semtree} | R Documentation |
Compute proximity matrix
Description
Compute a n by n matrix across all trees in a forest, where n is the number of rows in the data, reflecting the proportion of times two cases ended up in the same terminal node of a tree.
Usage
proximity(x, data, ...)
Arguments
x |
An object for which a method exists. |
data |
A data.frame on which proximity is computed |
... |
Parameters passed to other functions. |
Details
SEM Forest Case Proximity
Value
A matrix with dimensions [i, j] whose elements reflect the proportion of times case i and j were in the same terminal node of a tree.
Author(s)
Caspar J. Van Lissa, Andreas M. Brandmaier, John J. Prindle
References
Brandmaier, A.M., Oertzen, T. v., McArdle, J.J., & Lindenberger, U. (2013). Structural equation model trees. Psychological Methods, 18(1), 71-86.
See Also
Examples
nodeids <- structure(c(9, 3, 5, 7, 10, 4, 6, 8, 9, 3, 5, 7, 10, 4, 6, 8),
.Dim = c(4L, 4L))
class(nodeids) <- "semforest_node_id"
sims <- proximity(nodeids)
dd <- as.dist(1-sims)
hc <- hclust(dd)
groups <- cutree(hc, 2)
[Package semtree version 0.9.20 Index]