plotTree: Plot nodes of the representative tree

Description Usage Arguments Note References Examples

View source: R/plotTree.R

Description

This function visualizes the representative tree of the output of the ARMT function. For each node of the representative tree, the divide probability or the effect size is plotted. Each node in the tree is associated to a region of the sample space. All non-terminal nodes have two children nodes obtained by partitiing the parent region with a dyadic cut along a given direction. The numbers under the vertices represent the cutting direction.

Usage

1
2
plotTree(ans, type = "rej", group = 1, legend = FALSE, main = "",
  node.size = 5)

Arguments

ans

An ARMT object.

type

What is represented at each node. The options are type = c("eff", "rej").

group

If type = "eff", which group effect size is used.

legend

Color legend for type. Default is legend = FALSE.

main

Main title. Default is main = "".

node.size

Size of the nodes. Default is node.size = 5.

Note

The package igraph is required.

References

Soriano J. and Ma L. (2014). Multi-resolution two-sample comparison through the divide-merge Markov tree. Preprint. http://arxiv.org/abs/1404.3753

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set.seed(1)
p = 1
n1 = 200
n2 = 200
mu1 = matrix( c(0,10), nrow = 2, byrow=TRUE)
mu2 = mu1; mu2[2] = mu1[2] + .01
sigma = c(1,.1)

Z1 = sample(2, n1, replace=TRUE, prob=c(0.9, 0.1))
Z2 = sample(2, n2, replace=TRUE, prob=c(0.9, 0.1))
X1 = mu1[Z1] + matrix(rnorm(n1*p), ncol=p)*sigma[Z1]
X2 = mu2[Z2] + matrix(rnorm(n2*p), ncol=p)*sigma[Z1]
X = rbind(X1, X2)
G = c(rep(1, n1), rep(2,n2))

ans = ARMT(X, G, K=10)
plotTree(ans)

jacsor/ARMtree2 documentation built on May 17, 2017, 6:49 a.m.