tests  R Documentation 
These functions conduct tests of any networklevel statistic:
test_random()
performs a conditional uniform graph (CUG) test
of a measure against a distribution of measures on random networks
of the same dimensions.
test_permutation()
performs a quadratic assignment procedure (QAP) test
of a measure against a distribution of measures on permutations
of the original network.
test_gof()
performs a chisquared test on the squared Mahalanobis distance
between a diff_model and diff_models objects.
test_random(
.data,
FUN,
...,
times = 1000,
strategy = "sequential",
verbose = FALSE
)
test_permutation(
.data,
FUN,
...,
times = 1000,
strategy = "sequential",
verbose = FALSE
)
test_gof(diff_model, diff_models)
.data 
An object of a

FUN 
A graphlevel statistic function to test. 
... 
Additional arguments to be passed on to FUN, e.g. the name of the attribute. 
times 
Integer indicating number of simulations used for quantile estimation.
(Relevant to the null hypothesis test only 
the analysis itself is unaffected by this parameter.)
Note that, as for all Monte Carlo procedures, convergence is slower for more
extreme quantiles.
By default, 
strategy 
If 
verbose 
Whether the function should report on its progress.
By default FALSE.
See 
diff_model 
A diff_model object is returned by

diff_models 
A diff_models object is returned by

test_gof()
takes a single diff_model object,
which may be a single empirical or simulated diffusion,
and a diff_models object containing many simulations.
Note that currently only the goodness of fit of the
It returns a tibble (compatible with broom::glance()
) that includes
the Mahalanobis distance statistic
between the observed and simulated distributions.
It also includes a pvalue summarising a chisquared test on this statistic,
listing also the degrees of freedom and number of observations.
If the pvalue is less than the convention 0.05,
then one can argue that the first diffusion is not well captured by
Other models:
regression
marvel_friends < to_unsigned(ison_marvel_relationships)
marvel_friends < to_giant(marvel_friends) %>%
to_subgraph(PowerOrigin == "Human")
(cugtest < test_random(marvel_friends, network_heterophily, attribute = "Attractive",
times = 200))
plot(cugtest)
(qaptest < test_permutation(marvel_friends,
network_heterophily, attribute = "Attractive",
times = 200))
plot(qaptest)
# Playing a reasonably quick diffusion
x < play_diffusion(generate_random(15), transmissibility = 0.7)
# Playing a slower diffusion
y < play_diffusions(generate_random(15), transmissibility = 0.1, times = 40)
plot(x)
plot(y)
test_gof(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.