[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## [igraph] Assortative mixing

**From**: |
Thomas |

**Subject**: |
[igraph] Assortative mixing |

**Date**: |
Tue, 8 Nov 2011 10:21:57 +0000 |

`Does anyone have any guidance on the interpretation of the assortative
``coefficient (R code copied below)? Can it be assessed for significance
``as Pearson's r can? And if so, is the sample size the number of nodes
``in the network? Newman explains his approach in Column 1, Page 3 here: http://arxiv.org/pdf/cond-mat/0209450v2
`` but I couldn't follow it.
`
Thank you!
Thomas
#Code copied from: http://igraph.wikidot.com/r-recipes
#Assortativity coefficient in R
assortativity <- function(graph){
deg <- degree(graph)
deg.sq <- deg^2
m <- ecount(graph)
num1 <- 0; num2 <- 0; den <- 0
edges <- get.edgelist(graph, names=FALSE)+1
num1 <- sum(deg[edges[,1]] * deg[edges[,2]]) / m
num2 <- (sum(deg[edges[,1]] + deg[edges[,2]]) / (2 * m))^2
den <- sum(deg.sq[edges[,1]] + deg.sq[edges[,2]]) / (2 * m)
return((num1-num2)/(den-num2))
}

**[igraph] Assortative mixing**,
*Thomas* **<=**