I have a correlation coefficient of two hierarchical clustering trees with 20 labels.
I want to check the hypothesis that the labels of the trees are uncorrelated with a permutation test.
I calculated a p-value using 500 permutations
obsereved.coeff = 0.292
sample.permut <- c()
n <- 500
for(i in 1:n){
t = tree2 %>% dist(method = "euclidean") %>% hclust("complete") %>% as.dendrogram %>% set("labels",permute(row.names(tree2)))
sample.permut[i] = cor_bakers_gamma(tree1, t)
}
p-val = sum(abs(sample.permut)>=obsereved.coeff)/500
# p-value: 0.002
- are 500 permutations enough?
- is my p-value calculation correct?
- can I conclude that the labels of the two trees are related, with a 5% probability that the null is correct?