test_multimod | R Documentation |
Multimodality test for post clustering variable involvement
test_multimod(X, g, cl, k1, k2)
X |
The data matrix of size on which the clustering is applied |
g |
The variable on which the test is applied |
cl |
The labels of the data obtained thanks to a clustering algorithm |
k1 |
The first cluster of interest |
k2 |
The second cluster of interest |
A list containing : A list with the following elements
data_for_test
: The data used for the test
stat_g
: The dip statistic
pval
: The resulting p-values of the test computed with the diptest
function
X <- matrix(rnorm(200),ncol = 2) hcl_fun <- function(x){ return(as.factor(cutree(hclust(dist(x), method = "ward.D2"), k=2)))} cl <- hcl_fun(X) plot(X, col=cl) test_var1 <- test_multimod(X, g=1, k1=1, k2=2, cl = cl) test_var2 <- test_multimod(X, g=2, k1=1, k2=2, cl = cl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.