Divergence Tests of Goodness of Fit

Occurring cliques in association graphs represent connected components of dependent variables, and by comparing the graphs for different thresholds, specific structural models of multivariate dependence can be suggested and tested. The function div_gof() allows such hypothesis tests for pairwise independence of \(X\) and \(Y\): \(X \bot Y\), and pairwise independence conditional a third variable \(Z\): \(X\bot Y|Z\).

library(netropy)

Example:

For the running example using

head(dyad.var)
##   status gender office years age practice lawschool cowork advice friend
## 1      3      3      0     8   8        1         0      0      3      2
## 2      3      3      3     5   8        3         0      0      0      0
## 3      3      3      3     5   8        2         0      0      1      0
## 4      3      3      0     8   8        1         6      0      1      2
## 5      3      3      0     8   8        0         6      0      1      1
## 6      3      3      1     7   8        1         6      0      1      1

To test friend\(\bot\) cowork\(|\)advice, that is whether dyad variable friend is independent of cowork given advice we use the function as shown below:

div_gof(dat = dyad.var, var1 = "friend", var2 = "cowork", var_cond = "advice")
## the specified model of conditional independence cannot be rejected
##      D df(D)
## 1 0.94    12

Not specifying argument var_cond would instead test friend\(\bot\)cowork without any conditioning.

References

Frank, O., & Shafie, T. (2016). Multivariate entropy analysis of network data. Bulletin of Sociological Methodology/Bulletin de Méthodologie Sociologique, 129(1), 45-63. link