FR.test: Friedman-Rafsky (FR) test

Description Usage Arguments Value Author(s) Examples

View source: R/FR.test.R

Description

FR test is a multivariate generalization of nonparametric two-sample test. This function is an implementation with customized options, including a visualization of the minimum spanning tree (MST).

Usage

1
2
3
4
FR.test(samp1, samp2, use.cosine = FALSE, binary = FALSE,
  binary.cutoff = 2, plot.MST = FALSE, col = c("#F0E442", "#56B4E9"),
  label.names = c("Sample 1", "Sample 2"), vertex.size = 5,
  edge.width = 1, ...)

Arguments

samp1

Numeric matrix or data frame for Sample 1. Rows are multivariate dimensions, and columns are samples. E.g. gene by cell.

samp2

Numeric matrix or data frame for Sample 2.

use.cosine

An option if to use cosine distance. Logical variable. By default (FALSE), Euclidean distance is used.

binary

An option if to use binary values. Logical variable. Default: FALSE. If TRUE, use binary.cutoff to dichotomize samp1 and samp2.

binary.cutoff

Numeric value for binary cutoff. Binary value = 1 if greater than binary.cutoff, 0 otherwise. Default: 2.

plot.MST

Logical variable indicating if to plot the minimum spanning tree (MST). Default: FALSE.

col

Character vector of length two for customized colors of the nodes in MST. Default: c("#F0E442", "#56B4E9").

label.names

Character vector of length two for customized names of the two samples. Default: c("Sample 1","Sample 2").

vertex.size, edge.width, ...

Additional plotting parammeters passed to plot.igraph. Default: vertex.size=5, edge.width=1.

Value

Test statistics and p-value.

runs

Total number of subtrees.

runs.samp1

Number of subtrees of Sample 1.

runs.samp2

Number of subtrees of Sample 2.

stat

The standardized FR statistic.

p.value

P-value of the FR test.

Author(s)

Yun Zhang, [email protected]; Brian Aevermann, [email protected]; Richard Scheuermann, [email protected].

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
samp1 <- matrix(rnorm(100),nrow=5)
samp2 <- matrix(rnorm(100),nrow=5)
FR.test(samp1, samp2)
FR.test(samp1, samp2, use.cosine=TRUE)
FR.test(samp1, samp2, plot.MST=TRUE, main="Minimum spanning tree plot")
FR.test(samp1, samp2, binary=TRUE, binary.cutoff=1)

## End(Not run)

JCVenterInstitute/FRmatch documentation built on Jan. 25, 2020, 8:38 p.m.