用实际数据绘制树状图为'高度' r中的树而不是距离

发布于 2025-01-30 18:41:35 字数 631 浏览 4 评论 0原文

我想从关联矩阵中生成一个树状图(即,一个平方矩阵,其中包含我人群中每对个体的关联数据)。树状图应显示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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文