I have some prior knowledge of grouping, but this may be incorrect or is not sufficient as I need larger number of groups (i.e. subgroups). For example in the following data I have 3 groups in addition to two variables. I would like to use the group information (as prior knowledge) (here 3 groups) to create meaningful groups (here 9 groups/clusters). Is there a correct way to perform such analysis.

# Dummy data 
group <- rep(1:3, each =3000)
X <- c(rnorm(1000, 0.1, 0.04), rnorm(1000,0.2, 0.04), rnorm(1000, 0.4, 0.02),
       rnorm(1000, 0.4, 0.04), rnorm(1000,0.5, 0.08), rnorm(1000, 0.6, 0.12), 
       rnorm(1000, 0.7, 0.08), rnorm(1000,0.8, 0.1), rnorm(1000, 0.9, 0.06)

Y <-  c(rnorm(1000, 0.5, 0.04), rnorm(1000,0.6, 0.04), rnorm(1000, 0.7, 0.04),
       rnorm(1000, 0.35, 0.12), rnorm(1000,0.45, 0.04), rnorm(1000, 0.3, 0.02), 
       rnorm(1000, 0.55, 0.09), rnorm(1000,0.65, 0.12), rnorm(1000, 0.65, 0.04)

Prior information of 3 clusters:

col = c("red", "cyan", "green")
plot(cbind(X,Y), col = col[group], pch = ".")

enter image description here

Clustering analysis assuming 9 clusters.

cl <- kmeans(cbind(X,Y), 9)

colrs <- c("red","purple", "yellow", "tan", "pink", "cyan", "blue", "green", "black")
plot(cbind(X,Y), col = colrs[cl$cluster], pch = ".")

enter image description here

  • $\begingroup$ You are looking for a formal test of the existence of 9 distinct clusters when data are assessed in 2 dimensions. Is that right? $\endgroup$ – rolando2 Aug 5 '14 at 0:49
  • $\begingroup$ I am trying use the prior cluster information (i.e. group ) in my hand in cluster analysis (posterior information) - the cluster can be any number. Assumtion here is that prior cluster information can guide the clustering particularly in a confusion situation $\endgroup$ – rdorlearn Aug 5 '14 at 1:07

This is known in literature as constraint clustering.

You can specify "constraints", often in the form of

  • must-link, i.e. two objects that must be in the same cluster
  • cannot-link, i.e. two objects that must not be in the same cluster

It's a whole subdomain (although a tiny one) of clustering.

  • $\begingroup$ Constraint clustering is available in R package rioja ran.r-project.org/web/packages/rioja/rioja.pdf $\endgroup$ – Ram Sharma Aug 5 '14 at 13:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.