用实际数据绘制树状图为'高度' r中的树而不是距离
我想从关联矩阵中生成一个树状图(即,一个平方矩阵,其中包含我人群中每对个体的关联数据)。树状图应显示Y轴上的关联指数(比例为0至1),并且作为叶片标签。
我确实做了以下操作:
#Loaded my data i.e., association matrix :
HWI<-as.matrix(read.csv2(HWI.csv))
#Computed distances:
data.dist=dist(HWI, method = "euclidean")
#Did the clustering using the 'average-linkage method':
data.hclust=hclust(data.dist,method="average")
#Plotted the dendrogram:
hcd <- as.dendrogram(data.hclust)
plot(hcd, type = "rectangle", xlab = "Associative distance between individuals",horiz = TRUE)
问题是,树状图的高度是距离度量的距离度量,而不是关联索引。
有谁知道如何用关联索引(原始数据文件)将树状图绘制为y轴?
感谢您的建议。
前夕
I want to generate a dendrogram out of an association matrix (i.e., a squared matrix that contains association data for each pair of individuals in my population). The dendrogram should show the association index (scale 0 to 1) on the y axis and individuals as leaf labels.
I did as follows:
#Loaded my data i.e., association matrix :
HWI<-as.matrix(read.csv2(HWI.csv))
#Computed distances:
data.dist=dist(HWI, method = "euclidean")
#Did the clustering using the 'average-linkage method':
data.hclust=hclust(data.dist,method="average")
#Plotted the dendrogram:
hcd <- as.dendrogram(data.hclust)
plot(hcd, type = "rectangle", xlab = "Associative distance between individuals",horiz = TRUE)
The problem is, the height of the dendrogram is the distance measure, on which the clustering is based, and not the association index.
Does anyone know how I can plot the dendrogram with the association index (original data file) as y-axis instead?
Thanks a million for your suggestions.
Eve
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论