| compareARI {coseq} | R Documentation |
Provides the adjusted rand index (ARI) between pairs of clustering paritions.
compareARI(object, ...) ## S4 method for signature 'coseqResults' compareARI(object, K = NULL, parallel = FALSE, BPPARAM = bpparam(), plot = TRUE, ...) ## S4 method for signature 'matrix' compareARI(object, parallel = FALSE, BPPARAM = bpparam(), plot = TRUE, ...) ## S4 method for signature 'data.frame' compareARI(object, parallel = FALSE, BPPARAM = bpparam(), plot = TRUE, ...)
object |
Object of class |
... |
Additional optional parameters for corrplot |
K |
If |
parallel |
If |
BPPARAM |
Optional parameter object passed internally to |
plot |
If |
Matrix of adjusted rand index values calculated between each pair of models.
Andrea Rau
## Simulate toy data, n = 300 observations
set.seed(12345)
countmat <- matrix(runif(300*4, min=0, max=500), nrow=300, ncol=4)
countmat <- countmat[which(rowSums(countmat) > 0),]
conds <- rep(c("A","B","C","D"), each=2)
## Run the Normal mixture model for K = 2,3,4
run_arcsin <- coseq(object=countmat, K=2:4, iter=5, transformation="arcsin",
model="Normal")
run_arcsin
## Plot and summarize results
plot(run_arcsin)
summary(run_arcsin)
## Compare ARI values for all models (no plot generated here)
ARI <- compareARI(run_arcsin, plot=FALSE)
## Compare ICL values for models with arcsin and logit transformations
run_logit <- coseq(object=countmat, K=2:4, iter=5, transformation="logit",
model="Normal")
compareICL(list(run_arcsin, run_logit))
## Use accessor functions to explore results
clusters(run_arcsin)
likelihood(run_arcsin)
nbCluster(run_arcsin)
ICL(run_arcsin)
## Examine transformed counts and profiles used for graphing
tcounts(run_arcsin)
profiles(run_arcsin)
## Run the K-means algorithm for logclr profiles for K = 2,..., 20
run_kmeans <- coseq(object=countmat, K=2:20, transformation="logclr",
model="kmeans")
run_kmeans