Hi, Massimo.

Your code returns identical results to assortativity.degree(), so, I guess
you might consider switching to that function like I did.

Best,
Alex.

(Social | Network | Data) Analyst

Junior Research Fellow at the International Laboratory of Applied Network
Research
National Research University Higher School of Economics
http://anr.hse.ru/en/

http://jarens.ru
ru.linkedin.com/in/semenoffalex/
https://www.facebook.com/semenoffalex
https://twitter.com/jarens

skype: semenoffalex
tel: +7 926 602 25 51



2015-01-29 20:22 GMT+03:00 Massimo Franceschet <[email protected]
>:

> > 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
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>
_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to