treeSimilarity: Returns a measure of how similar the two trees are.

Description Usage Arguments Value See Also Examples

View source: R/other_useful_fns.R

Description

Computes the Adjusted Rand Index of the clusterings of the population created by the two trees. In the case of correlated covariates, two trees that split on entirely different variables may actually describe similar partitions of the population. This metric allows us to detect when two trees are partitioning the population similarly. A value close to 1 indicates a similar clustering.

Usage

1
treeSimilarity(tree1, tree2)

Arguments

tree1

a model returned from splineTree()

tree2

a model returned from splineTree()

Value

The Adjusted Rand Index of the clusterings created by the two trees.

See Also

mclust::adjustedRandIndex

Examples

1
2
3
4
5
splitForm <- ~SEX+Num_sibs+HGC_MOTHER+HGC_FATHER
nlsySubset <- nlsySample[nlsySample$ID %in% sample(unique(nlsySample$ID), 400),]
tree1 <- splineTree(splitForm, BMI~AGE, "ID", nlsySubset, degree=1, df=2, intercept=FALSE, cp=0.005)
tree2 <- splineTree(splitForm, BMI~AGE, "ID", nlsySubset, degree=1, df=3, intercept=TRUE, cp=0.005)
treeSimilarity(tree1, tree2)

splinetree documentation built on July 18, 2019, 9:08 a.m.