I have a networkx graph which has couple of attributes and I have calculated their attribute assortativity, now I want to be sure that these assortativity values are not due to chance, so what I want to do is to generate multiple random graphs, then calculate their attribute assortativity and finally using bootstrap calculate their p-value.
However, I don't know how to make this randomised network, that be random while preserving important characteristic of my network. so far I created their edge list then shuffled their edges and create new randomised edges, Does this make sense?
then for the p-values, I apply this code, but I think its not complete, how to calculate the two-tailed p-value?
for value in random_assortativity_values:
if value > original_assortativity:
count = count+1
pvalue = (count/len(random_assortativity_values))
The p-values by this method are all 0, does this mean that my attributes are all statistically significant?