Uri, thanks, that's kind of you, but actually it is
not included in igraph. But it very simple to do it:
centralize <- function(scores, tmax, normalize=TRUE) {
cent <- sum(max(scores)-scores)
if (normalize) {
cent <- cent/tmax
}
cent
}
It is a bit different than sna, you have to give the 'tmax'
argument 'by hand', as igraph centrality functions do not support
returning the theoretical maximum. Here is how to use it:
library(igraph)
g <- simplify(ba.game(1000, m=2))
centralize(degree(g), tmax=997002, normalize=TRUE)
g2 <- erdos.renyi.game(1000, 4/999)
centralize(degree(g2), tmax=997002, normalize=TRUE)
Unfortunately, you'll need to calculate the theoretical
maximum for the hub scores..... You can see the evcent
function of SNA (tmaxdev=TRUE) to get a hint....
Please tell me if you could find it out.
Gabor
ps. please consider writing to the igraph-help mailing list
next time. Thanks.
On Thu, Jun 19, 2008 at 02:49:57PM -0400, Uri Shwed wrote:
Dear Gabor,
Does igraph supports a general centralization calculation, like sna? I
need a GLI for Klienberg hub and authority scores. Knowing igraph's
style, I'm sure its there somewhere....
Thanks,
Uri