|
From: | Alexander Semenov |
Subject: | Re: [igraph] Computing assortativity via degree correlation |
Date: | Sat, 7 Feb 2015 22:46:32 +0300 |
> I've tried 3 different versions of code to calculate assortativity via
> degree correlation and two of them returned NA, while the third gave some
> reasonable numbers. My quistion is: can I trust it and why could 2 other
> receipts fail?
I use this:
# g is a graph
d = degree(g)
e = get.edgelist(g)
x = c(e[,1], e[,2])
y = c(e[,2], e[,1])
dx = d[x]
dy = d[y]
cor(dx, dy)
This corresponds to equation (7.82) page 230 of Mark Newman's book (Networks).
Best,
Massimo Franceschet
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |