bn3: Computes Bn Statistic for 3 Groups.

Description Usage Arguments Details Value Examples

View source: R/bn3.R

Description

Returns the value for the Bn statistic that measures the degree of separation between three groups. The statistic is computed as a combination of differences of average within group and between group distances. Large values of Bn indicate large group separation. Under overall sample homogeneity we have E(Bn)=0.

Usage

1
bn3(group_id, md = NULL, data = NULL)

Arguments

group_id

A vector of 1s, 2s and 3s 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.

Details

Either data OR md should be provided. If data are entered directly, Bn will be computed considering the squared Euclidean distance.

For more detail see Bello, Debora Zava, Marcio Valk and Gabriela Bettella Cybis. "Clustering inference in multiple groups." arXiv preprint arXiv:2106.09115 (2021).

Value

Value of the Bn3 statistic.

Examples

1
2
3
4
5
6
n=7
set.seed(1234)
x=matrix(rnorm(n*10),ncol=10)
bn3(c(1,2,2,2,3,3,3),data=x)     # option (a) entering the data matrix directly
md=as.matrix(dist(x))^2
bn3(c(1,2,2,2,3,3,3),md)         # option (b) entering the distance matrix

uclust documentation built on June 19, 2021, 1:06 a.m.