proximity | R Documentation |

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.

```
proximity(x, data, ...)
```

`x` |
An object for which a method exists. |

`data` |
A data.frame on which proximity is computed |

`...` |
Parameters passed to other functions. |

SEM Forest Case Proximity

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.

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

Brandmaier, A.M., Oertzen, T. v., McArdle, J.J., & Lindenberger,
U. (2013). Structural equation model trees. *Psychological Methods*,
18(1), 71-86.

`semforest`

, `semtree`

```
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)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.