1

I have a social network with a modularity of 0.88 (I used cluster_edge_betweenness). From what I can understand I need to create a number of null networks and use the resulting modularity distribution from them to assess if the modularity from my observed network is statistically significant. I can make null networks using nullmodel and simulate but I have no idea how to get the modularity distribution back from the null networks.

From what I've found online, I need to do something along the lines of this:

d <- array(dim=c(10000, vcount(gftest)))
c=numeric(10000)
r=numeric(10000)
for (i in 1:10000) {random_network=sample_degseq(d0)
random_network=simplify(random_network)
r[i]=cluster_edge_betweenness(random_network)
c[i]=transitivity(random_network, type="global")
}

which returns the error message:

In r[i] <- cluster_edge_betweenness(random_network) : number of items to replace is not a multiple of replacement length

or this:

nulltest <- nullmodel(amg1, "r00")
test2 <-simulate(nulltest, nsim = 1000)
oecosimu(nulltest, modularity(??), "r00", nsimul = 99, statistic = "Q", alternative = c("two.sided"))

which doesn't work.

Ben
  • 28,684
  • 5
  • 23
  • 45
confused
  • 41
  • 2
  • 1
    Welcome to StackOverflow! Could you specify the packages used, and make your example reproducible so that it can readily be copy-pasted and ran as is to reproduce the issue? See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Aurèle Mar 31 '20 at 13:38

0 Answers0