[英]Why does hclust gives a different cluster than pvclust in r?
我試圖在以下數據集上獲取用於層次聚類分析的p值。pvclust和hclust生成的樹狀圖完全不同。由於pvclust提到它們使用與hclust相同的方法,因此應該相同。
require(vegan)
test
S1 S2 S3 S4 S5 S6 S7 S8 S9 S10
1 1 1 1 1 1 1 0 1 1 0
2 0 0 1 0 0 0 0 0 0 0
3 1 0 0 1 1 0 0 0 1 1
4 1 0 1 0 1 1 0 1 0 1
5 0 1 0 1 0 0 0 0 1 0
6 1 0 1 0 1 1 0 0 0 1
7 1 1 0 1 0 0 1 0 1 0
8 1 1 0 1 0 1 1 0 1 0
9 1 0 1 0 1 1 0 1 0 0
div.norm=decostand(test,"normalize")
div.ch=vegdist(div.norm,"bray")
div.ch.UPGMA=hclust(div.ch,method = "average")
plot(div.ch.UPGMA)
這將生成以下樹狀圖: 使用hclust進行聚類然后,我嘗試使用pvclust運行相同的數據集。
require(pvclust)
test.tr=t(test)
result=pvclust(test.tr, method.dist="cor", method.hclust="average", nboot=1000)
plot(result)
我得到以下樹狀圖,它不同於hclust生成的樹狀圖。 使用pvclust進行群集
有些人建議我不要轉置數據。 但這會產生一個樹狀圖,其中的列是聚集的(我不想要這樣)。
任何幫助將不勝感激!
您正在使用的層次集群的pvclust
實現依賴於引導重采樣。 這引入了一定程度的隨機性, pvclust
運行之間可能會得到不同的結果,因此您應該期望它與hclust
。
此外,在運行pvclust
,您可能已經注意到了一些相當嚴重的警告:
Bootstrap (r = 0.5)... Done. Bootstrap (r = 0.6)... Done. Bootstrap (r = 0.7)... Done. Bootstrap (r = 0.8)... Done. Bootstrap (r = 0.9)... Done. Bootstrap (r = 1.0)... Done. Bootstrap (r = 1.1)... Done. Bootstrap (r = 1.2)... Done. Bootstrap (r = 1.3)... Done. Bootstrap (r = 1.4)... Done. Warning messages: 1: inappropriate distance matrices are omitted in computation: r = 0.5 2: inappropriate distance matrices are omitted in computation: r = 0.6 3: inappropriate distance matrices are omitted in computation: r = 0.7 4: inappropriate distance matrices are omitted in computation: r = 0.8 5: inappropriate distance matrices are omitted in computation: r = 0.9 6: inappropriate distance matrices are omitted in computation: r = 1 7: inappropriate distance matrices are omitted in computation: r = 1.1 8: inappropriate distance matrices are omitted in computation: r = 1.2 9: inappropriate distance matrices are omitted in computation: r = 1.3 10: inappropriate distance matrices are omitted in computation: r = 1.4
由於pvclust
每個迭代都具有無法使用的距離矩陣,因此應謹慎解釋結果,這可能會使它們無效並對其進行重大更改。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.