gof_test {multigraphr} | R Documentation |
Goodness of fit tests between an observed edge multiplicity sequence and an expected edge multiplicity sequence according to specified RSM or IEA hypotheses using Pearson (S) and information divergence (A) tests statistics.
gof_test(adj, type, hyp, deg.hyp, dof)
adj |
matrix of integer representing graph adjacency matrix. |
type |
equals |
hyp |
character string representing the null model, either |
deg.hyp |
vector of integers with the sum equal to to 2 |
dof |
integer giving degrees of freedom of test, r-1 for simple hypotheses and r-n for composite hypotheses where r = n(n+1)/2 |
This function can be used to test whether there is a significant difference between observed multigraph and the expected multiplicity sequence according to a simple or composite IEA hypothesis.
Test statistics of Pearson (S) and of information divergence (A) type are used and test summary based on these two statistics are given as output.
p-values indicate whether we have sufficient evidence to reject the null that there is no significant difference between the observed and expected edge multiplicity sequence.
summary |
Data frame including observed values of test statistics |
Termeh Shafie
Shafie, T. (2015). A Multigraph Approach to Social Network Analysis. Journal of Social Structure, 16.
Shafie, T. (2016). Analyzing Local and Global Properties of Multigraphs. The Journal of Mathematical Sociology, 40(4), 239-264.
#' Shafie, T., Schoch, D. (2021). Multiplexity analysis of networks using multigraph representations. Statistical Methods & Applications 30, 1425–1444.
get_degree_seq
,get_edge_assignment_probs
,
gof_sim
to check the reliability of your test
# Adjacency matrix of observed network (multigraph), n = 4 nodes , m = 15 edges
A <- t(matrix(c( 0, 1, 0, 3,
0, 0, 1, 7,
0, 1, 0, 3,
3, 6, 3, 2), nrow= 4, ncol=4))
deg <- get_degree_seq(adj = A, type = 'multigraph')
# Testing a simple IEAS hypothesis with above degree sequence
gof_test(adj = A, type = 'multigraph', hyp = 'IEAS', deg.hyp = deg, dof = 9)
# Testing a composite IEAS hypothesis
gof_test(adj = A, type = 'multigraph', hyp = 'IEAS', deg.hyp = 0, dof = 6)