Learn R Programming

semtree (version 0.9.20)

proximity: 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, ...)

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.

Arguments

x

An object for which a method exists.

data

A data.frame on which proximity is computed

...

Parameters passed to other functions.

Author

Caspar J. Van Lissa, Andreas M. Brandmaier, John J. Prindle

Details

SEM Forest Case Proximity

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

semforest, semtree

Examples

Run this code
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)

Run the code above in your browser using DataLab