knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 12, message = FALSE, warning = FALSE, tidy.opts = list( keep.blank.line = TRUE, width.cutoff = 150 ), options(width = 150), eval = TRUE ) library(FractCurve)
fract_curve() function in FractCurve package can be used for various purpose. Deciding the number of clusters in an exploratory data analyses is one of them. In this vignette, an explanation of the algorithm for utilizing fract_curve() function in this purpose is presented. Also, a result from simulation study is shown. The analysis can be conducted from the fract_curve_clust() function, which is a wrapper function of fract_curve(), in this package. If you have not read the vignette on fract_curve(), you can invoke from this package by using vignette("FractCurve", "FractCurve").
Suppose that you you have a dataset with the size of 50, the features of 32 variables. There are 8 subgroups in the population from which the data was sampled, and the characteristics of the subgroups are represented by the 32 features. This situation is simulated by the R code below:
for(i in 1:10){ mat_i <- matrix( c( rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1), rnorm(200,rnbinom(n = 1, size = 10, mu = 5)-1,1) ), ncol = 50 ) if(i==1){mat <- mat_i}else{mat <- rbind(mat,mat_i)} } heatmap(mat)
Using fract_curve_clust() function, that is a wrapper function of fract_curve(), the number of subgroups in the population can be detected as below.
res.fract_curve_clust <- fract_curve_clust( df.features = as.data.frame(mat), method.dist.row = "manhattan", method.dist.col = "manhattan", method.hclust.row = "ward", method.hclust.col = "ward", dir.output = NULL, get.df_of_IYs=FALSE, fn.plot_pdf =NULL, fn.df_of_IYs = NULL, fisher_test = FALSE )
we are seeking.
As explained in the previous section, .
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.