linkSignificance allows to estimate the statistical deviations of an observed graph from a ghype model.

linkSignificance(
  graph,
  model,
  under = FALSE,
  log.p = FALSE,
  binomial.approximation = FALSE,
  give_pvals = FALSE
)

link_significance(
  graph,
  model,
  under = FALSE,
  log.p = FALSE,
  binomial.approximation = FALSE,
  give_pvals = FALSE
)

Arguments

graph

an adjacency matrix or a igraph object.

model

a ghype model

under

boolean, estimate under-represented deviations? Default FALSE.

log.p

boolean, return log values of probabilities

binomial.approximation

boolean, force binomial? default FALSE

give_pvals

boolean, return p-values for both under and over significance?

Value

matrix of probabilities with same size as adjacency matrix.

Examples

data("adj_karate") fullmodel <- ghype(graph = adj_karate, directed = FALSE, selfloops = FALSE) link_significance(graph = adj_karate, model = fullmodel, under=FALSE)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] #> [1,] 0.0000000 0.3692607 0.3818988 0.3511372 0.3511456 0.3511389 0.3511396 #> [2,] 0.3692607 0.0000000 0.3913526 0.3511401 1.0000000 1.0000000 1.0000000 #> [3,] 0.3818988 0.3913526 0.0000000 0.3511389 1.0000000 1.0000000 1.0000000 #> [4,] 0.3511372 0.3511401 0.3511389 0.0000000 1.0000000 1.0000000 1.0000000 #> [5,] 0.3511456 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 0.3220270 #> [6,] 0.3511389 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 0.3819993 #> [7,] 0.3511396 1.0000000 1.0000000 1.0000000 0.3220270 0.3819993 0.0000000 #> [8,] 0.3220130 0.3692809 0.3692770 0.3511532 1.0000000 1.0000000 1.0000000 #> [9,] 0.3220126 1.0000000 0.3819194 1.0000000 1.0000000 1.0000000 1.0000000 #> [10,] 1.0000000 1.0000000 0.2633541 1.0000000 1.0000000 1.0000000 1.0000000 #> [11,] 0.3220148 1.0000000 1.0000000 1.0000000 0.3512128 0.3511786 1.0000000 #> [12,] 0.3511708 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [13,] 0.2633532 1.0000000 1.0000000 0.3512028 1.0000000 1.0000000 1.0000000 #> [14,] 0.3511375 0.3819246 0.3511394 0.3511475 1.0000000 1.0000000 1.0000000 #> [15,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [16,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [17,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3511936 0.3511983 #> [18,] 0.3220232 0.2633543 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [19,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [20,] 0.3220179 0.3220219 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [21,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [22,] 0.3220200 0.3220248 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [23,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [24,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [25,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [26,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [27,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [28,] 1.0000000 1.0000000 0.3220138 1.0000000 1.0000000 1.0000000 1.0000000 #> [29,] 1.0000000 1.0000000 0.3220186 1.0000000 1.0000000 1.0000000 1.0000000 #> [30,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [31,] 1.0000000 0.3220152 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [32,] 0.3220124 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [33,] 1.0000000 1.0000000 0.3220127 1.0000000 1.0000000 1.0000000 1.0000000 #> [34,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [,8] [,9] [,10] [,11] [,12] [,13] [,14] #> [1,] 0.3220130 0.3220126 1.0000000 0.3220148 0.3511708 0.2633532 0.3511375 #> [2,] 0.3692809 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3819246 #> [3,] 0.3692770 0.3819194 0.2633541 1.0000000 1.0000000 1.0000000 0.3511394 #> [4,] 0.3511532 1.0000000 1.0000000 1.0000000 1.0000000 0.3512028 0.3511475 #> [5,] 1.0000000 1.0000000 1.0000000 0.3512128 1.0000000 1.0000000 1.0000000 #> [6,] 1.0000000 1.0000000 1.0000000 0.3511786 1.0000000 1.0000000 1.0000000 #> [7,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [8,] 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [9,] 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [10,] 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [11,] 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 #> [12,] 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 #> [13,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 #> [14,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 #> [15,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [16,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [17,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [18,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [19,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [20,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [21,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [22,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [23,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [24,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [25,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [26,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [27,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [28,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [29,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [30,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [31,] 1.0000000 0.3511592 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [32,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [33,] 1.0000000 0.3511382 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [34,] 1.0000000 0.3692644 0.3220214 1.0000000 1.0000000 1.0000000 0.3511368 #> [,15] [,16] [,17] [,18] [,19] [,20] [,21] #> [1,] 1.0000000 1.0000000 1.0000000 0.3220232 1.0000000 0.3220179 1.0000000 #> [2,] 1.0000000 1.0000000 1.0000000 0.2633543 1.0000000 0.3220219 1.0000000 #> [3,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [4,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [5,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [6,] 1.0000000 1.0000000 0.3511936 1.0000000 1.0000000 1.0000000 1.0000000 #> [7,] 1.0000000 1.0000000 0.3511983 1.0000000 1.0000000 1.0000000 1.0000000 #> [8,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [9,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [10,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [11,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [12,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [13,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [14,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [15,] 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [16,] 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [17,] 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [18,] 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 #> [19,] 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 1.0000000 #> [20,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 #> [21,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 #> [22,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [23,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [24,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [25,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [26,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [27,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [28,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [29,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [30,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [31,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [32,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [33,] 0.3511579 0.3511499 1.0000000 1.0000000 0.2633538 1.0000000 0.3511647 #> [34,] 0.3220168 0.3692841 1.0000000 1.0000000 0.3220214 0.2633528 0.2633530 #> [,22] [,23] [,24] [,25] [,26] [,27] [,28] #> [1,] 0.3220200 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [2,] 0.3220248 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [3,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3220138 #> [4,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [5,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [6,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [7,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [8,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [9,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [10,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [11,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [12,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [13,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [14,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [15,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [16,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [17,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [18,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [19,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [20,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [21,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [22,] 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [23,] 1.0000000 0.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [24,] 1.0000000 1.0000000 0.0000000 1.0000000 0.3819543 1.0000000 0.3692931 #> [25,] 1.0000000 1.0000000 1.0000000 0.0000000 0.3220278 1.0000000 0.3511891 #> [26,] 1.0000000 1.0000000 0.3819543 0.3220278 0.0000000 1.0000000 1.0000000 #> [27,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.0000000 1.0000000 #> [28,] 1.0000000 1.0000000 0.3692931 0.3511891 1.0000000 1.0000000 0.0000000 #> [29,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [30,] 1.0000000 1.0000000 0.3511497 1.0000000 1.0000000 0.3693977 1.0000000 #> [31,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [32,] 1.0000000 1.0000000 1.0000000 0.3220218 0.3988727 1.0000000 1.0000000 #> [33,] 1.0000000 0.3220189 0.3819084 1.0000000 1.0000000 1.0000000 1.0000000 #> [34,] 1.0000000 0.3511518 0.3692621 1.0000000 1.0000000 0.3220156 0.3692684 #> [,29] [,30] [,31] [,32] [,33] [,34] #> [1,] 1.0000000 1.0000000 1.0000000 0.3220124 1.0000000 1.0000000 #> [2,] 1.0000000 1.0000000 0.3220152 1.0000000 1.0000000 1.0000000 #> [3,] 0.3220186 1.0000000 1.0000000 1.0000000 0.3220127 1.0000000 #> [4,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [5,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [6,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [7,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [8,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [9,] 1.0000000 1.0000000 0.3511592 1.0000000 0.3511382 0.3692644 #> [10,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3220214 #> [11,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [12,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [13,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [14,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3511368 #> [15,] 1.0000000 1.0000000 1.0000000 1.0000000 0.3511579 0.3220168 #> [16,] 1.0000000 1.0000000 1.0000000 1.0000000 0.3511499 0.3692841 #> [17,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [18,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [19,] 1.0000000 1.0000000 1.0000000 1.0000000 0.2633538 0.3220214 #> [20,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.2633528 #> [21,] 1.0000000 1.0000000 1.0000000 1.0000000 0.3511647 0.2633530 #> [22,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 #> [23,] 1.0000000 1.0000000 1.0000000 1.0000000 0.3220189 0.3511518 #> [24,] 1.0000000 0.3511497 1.0000000 1.0000000 0.3819084 0.3692621 #> [25,] 1.0000000 1.0000000 1.0000000 0.3220218 1.0000000 1.0000000 #> [26,] 1.0000000 1.0000000 1.0000000 0.3988727 1.0000000 1.0000000 #> [27,] 1.0000000 0.3693977 1.0000000 1.0000000 1.0000000 0.3220156 #> [28,] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 0.3692684 #> [29,] 0.0000000 1.0000000 1.0000000 0.3220238 1.0000000 0.3220156 #> [30,] 1.0000000 0.0000000 1.0000000 1.0000000 0.3692733 0.3220128 #> [31,] 1.0000000 1.0000000 0.0000000 1.0000000 0.3511425 0.3511399 #> [32,] 0.3220238 1.0000000 1.0000000 0.0000000 0.3692647 0.3692621 #> [33,] 1.0000000 0.3692733 0.3511425 0.3692647 0.0000000 0.3818967 #> [34,] 0.3220156 0.3220128 0.3511399 0.3692621 0.3818967 0.0000000