Reputation: 17
I'm working with a matrix that contains several entries and their similarity in the following format:
// A B C
A 1 0.8 0.4
B 0.8 1 0.2
C 0.4 0.2 1
In this case, 1 means that two entries are identical, 0 that they are completely different. Each entry represents one string of observations that are either present or not. The similarity value is calculated by checking for overlapping observations. I would like to visualize this relation of the different entries; would it be possible to use a dendrogram in this case?
Upvotes: 0
Views: 478
Reputation: 37641
Here are two ways to visualize your matrix.
corrplot
library(corrplot)
corrplot(Mat)
hclust
Your matrix is similarity but for hclust
, we need dis similarity, so I will transform it using 1 - Mat.
HC = hclust(as.dist(1-Mat))
plot(HC)
Upvotes: 1