utest: U test

Description Usage Arguments Details Value See Also Examples

Description

Test for the separation of two groups. The null hypothesis states that the groups are homogeneous and the alternative hypothesis states that they are separate.

Usage

1
utest(group_id, md = NULL, data = NULL, numB = 1000)

Arguments

group_id

A vector of 0s and 1s indicating to which group the samples belong. Must be in the same order as data or md.

md

Matrix of distances between all data points.

data

Data matrix. Each row represents an observation.

numB

Number of resampling iterations.

Details

Either data or md should be provided. If data are entered directly, Bn will be computed considering the squared Euclidean distance, which is compatible with is_homo, uclust and uhclust.

For more details see Cybis, Gabriela B., Marcio Valk, and Sílvia RC Lopes. "Clustering and classification problems in genetics through U-statistics." Journal of Statistical Computation and Simulation 88.10 (2018)

Value

Returns a list with the following elements:

Bn

Test Statistic

Pvalue

Replication based p-value

Replication

Number of replications used to compute p-value

See Also

bn,is_homo

Examples

1
2
3
4
5
6
7
8
# Simulate a dataset with two separate groups, the first 5 rows have mean 0 and
# the last 5 rows have mean 5.
data <- matrix(c(rnorm(75, 0), rnorm(75, 5)), nrow = 10, byrow=TRUE)

# U test for mixed up groups
utest(group_id=c(1,0,1,0,1,0,1,0,1,0), data=data, numB=3000)
# U test for correct group definitions
utest(group_id=c(1,1,1,1,1,0,0,0,0,0), data=data, numB=3000)

gcybis/Uclust documentation built on May 8, 2019, 1:20 p.m.