library(igraph)
library(intergraph)
library(sna)
# create the graphs
gs <- replicate(2,
sample_gnm(281, 447,m = 465, directed = FALSE),
simplify = F)
# sample_gnm is preferred to erdos.renyi.game now
# turn them into network objects
nets <- lapply(gs, asNetwork)
Теперь используйте gcor
для получения корреляции и qaptest
для проверки значимости.
gcor(nets, g1 = 1, g2 =2)
[1] 0.003537025
qaptest(nets, gcor, g1 = 1, g2 = 2)
QAP Test Results
Estimated p-values:
p(f(perm) >= f(d)): 0.17
p(f(perm) <= f(d)): 0.834