utest {uclust} | R Documentation |
U test
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
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
Examples
# 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)