[R] help with EMclust

Sundar Dorai-Raj sundar.dorai-raj at pdf.com
Sun Nov 16 18:07:47 CET 2003



Sreedevi Gopalan wrote:
> we have implemented teh following code for determinging the clustering
> model of a dataset.
>  
> bicvals <- EMclust( hdata, 7)
>  sumry1 <- summary(bicvals, hdata,7) # summary object for emclust()
>  print(sumry1)
> 
>  This set of code gives the following output
>  
> classification table:
>  
> 1 2 3 4 5 6 7 
> 1 1 1 4 1 1 1 
>  
> which I think means there is 1 gene in the 1st cluster...1 gene in the
> 2nd cluster , 4 genes in the 4th cluster and so on....But I need to know
> which gene is in which cluster.
>  
> Is there any way to find that out....
>  

Here's an example:

R> data(iris)
R> irisMatrix <- as.matrix(iris[,1:4])
R> irisBic <- EMclust(irisMatrix)
R> irisBest <- summary(irisBic, irisMatrix)
R> names(irisBest)
  [1] "bic"            "options"
  [3] "classification" "uncertainty"
  [5] "n"              "d"
  [7] "G"              "z"
  [9] "mu"             "sigma"
[11] "decomp"         "pro"
[13] "loglik"         "Vinv"
[15] "modelName"
R> irisBest$classification
   [1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
  [23] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
  [45] 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
  [67] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
  [89] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
[111] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
[133] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
R>

Hope this helps,

Sundar




More information about the R-help mailing list