I have made a co-occurrence matrix like the one in the pic below (numbers = percentages row-wise. So, out of all the times E was in a group, 8.17% of the times was with A, 7.36% of the times with B, 25.34% of the times C, etc):
heatmap with co-occurrences
I would say that, clearly, there are two main clusters: [A,B] and [C,D,E]. However, I am struggling to find a way to get some inferential statistics out of it with R.
I have my data stored in two ways:
- A simple co-occurrences matrix, basically the pic
- a matrix with three columns:
data = as.matrix(
group =c("A","A","A","A","A","B","B","B","B","B","C","C","C","C","C","D","D","D","D","D","E","E","E","E","E"),
group2 =c("A","B","C","D","E","A","B","C","D","E","A","B","C","D","E","A","B","C","D","E","A","B","C","D","E"),
count=c(35.21 ,29.63, 8.47 , 9.94 , 8.17 ,30.99 ,44.44 , 7.34, 6.63 , 7.36,10.56 , 8.75 ,31.07, 26.24,25.34, 12.68 , 8.08 ,26.84, 39.78, 17.17, 10.56, 9.09, 26.27 ,17.40 41.96)
)
I managed to find caret::confusionMatrix, but it doesn’t seem to work with the way my data is structured.
Do you happen to know how I could get some stats like those confusionMatrix() would give (see, for instance, here)