VerifyTree: Verify tree structure

Description Usage Arguments Details Value Author(s) References Examples

View source: R/VerifyTree.R

Description

Given a matrix of data, where the rows are observations and the columns are variables, it verifies the statistical significance of hierarchical nodes provided by hclust, through the use of the empirical matrix of Spearman's rho.

Usage

1
2
VerifyTree(data, alpha = 0.95, nboot = 500, distance.method = "maximum",
  hclust.method = "complete")

Arguments

data

data used for the clustering

alpha

the confidence level for the tests

nboot

the number of bootstrap samples to use

distance.method

method for the distance matrix

hclust.method

method for the clustering

Details

The hypothesis testing, as well as the clustering, is made with the matrix of Spearman's rho for a given dataset, see \insertCitegaisser2010testingerhcv.

Value

A list, containing the bootrap samples and the initial tree structure, modified, according to the results of the tests

Author(s)

Simon-Pierre Gadoury

References

\insertRef

gaisser2010testingerhcv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require(HAC)
str <- hac(type = 1, tree = list(list(list("X4", "X5", 6),
                                      "X6", 3), "X1", list("X2", "X3", 10), 1))

set.seed(2018)
U.. <- rHAC(1000, str)
U.. <- U..[,c(4, 5, 6, 1, 2, 3)]

## Tree via hclust
spear <- cor(U.., method = "sp")
clust <- hclust(dist(spear, method = "maximum"),
                method = "complete")
tree1 <- hclust2tree(clust)

## Tree after verification
tree2 <- VerifyTree(U.., alpha = 0.95,
                    distance.method = "maximum",
                    hclust.method = "complete")$Tree

## Comparison
par(mfrow = c(1, 3))
tree2plot(tree1)
tree2plot(tree2)
plot(str)
par(mfrow = c(1, 3))

erhcv documentation built on May 1, 2019, 6:28 p.m.

Related to VerifyTree in erhcv...